JsonSchemaExporter.GetJsonSchemaAsNode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions) |
Generates a JSON schema corresponding to the specified contract metadata. |
GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions) |
Generates a JSON schema corresponding to the contract metadata of the specified type. |
GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions)
- Source:
- JsonSchemaExporter.cs
Generates a JSON schema corresponding to the specified contract metadata.
public static System.Text.Json.Nodes.JsonNode GetJsonSchemaAsNode (this System.Text.Json.Serialization.Metadata.JsonTypeInfo typeInfo, System.Text.Json.Schema.JsonSchemaExporterOptions? exporterOptions = default);
static member GetJsonSchemaAsNode : System.Text.Json.Serialization.Metadata.JsonTypeInfo * System.Text.Json.Schema.JsonSchemaExporterOptions -> System.Text.Json.Nodes.JsonNode
<Extension()>
Public Function GetJsonSchemaAsNode (typeInfo As JsonTypeInfo, Optional exporterOptions As JsonSchemaExporterOptions = Nothing) As JsonNode
Parameters
- typeInfo
- JsonTypeInfo
The contract metadata for which to generate the schema.
- exporterOptions
- JsonSchemaExporterOptions
The exporterOptions object controlling the schema generation.
Returns
A new JsonNode instance defining the JSON schema for typeInfo
.
Exceptions
One of the specified parameters is null
.
The typeInfo
parameter contains unsupported exporterOptions.
Applies to
GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions)
- Source:
- JsonSchemaExporter.cs
Generates a JSON schema corresponding to the contract metadata of the specified type.
public static System.Text.Json.Nodes.JsonNode GetJsonSchemaAsNode (this System.Text.Json.JsonSerializerOptions options, Type type, System.Text.Json.Schema.JsonSchemaExporterOptions? exporterOptions = default);
static member GetJsonSchemaAsNode : System.Text.Json.JsonSerializerOptions * Type * System.Text.Json.Schema.JsonSchemaExporterOptions -> System.Text.Json.Nodes.JsonNode
<Extension()>
Public Function GetJsonSchemaAsNode (options As JsonSerializerOptions, type As Type, Optional exporterOptions As JsonSchemaExporterOptions = Nothing) As JsonNode
Parameters
- options
- JsonSerializerOptions
The options instance from which to resolve the contract metadata.
- type
- Type
The root type for which to generate the JSON schema.
- exporterOptions
- JsonSchemaExporterOptions
The exporterOptions object controlling the schema generation.
Returns
A new JsonNode instance defining the JSON schema for type
.
Exceptions
One of the specified parameters is null
.
The options
parameter contains unsupported exporterOptions.