JsonSchemaExporter.GetJsonSchemaAsNode 方法

定义

重载

名称 说明
GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions)

生成对应于指定协定元数据的 JSON 架构。

GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions)

生成与指定类型的协定元数据对应的 JSON 架构。

GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions)

Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs

生成对应于指定协定元数据的 JSON 架构。

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

参数

typeInfo
JsonTypeInfo

要为其生成架构的协定元数据。

exporterOptions
JsonSchemaExporterOptions

控制架构生成的 exporterOptions 对象。

返回

定义 JSON typeInfo架构的新JsonNode实例。

例外

指定的参数之一是 null

typeInfo 参数包含不支持的 exporterOptions。

适用于

GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions)

Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs
Source:
JsonSchemaExporter.cs

生成与指定类型的协定元数据对应的 JSON 架构。

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

参数

options
JsonSerializerOptions

用于解析协定元数据的选项实例。

type
Type

要为其生成 JSON 架构的根类型。

exporterOptions
JsonSchemaExporterOptions

控制架构生成的 exporterOptions 对象。

返回

定义 JSON type架构的新JsonNode实例。

例外

指定的参数之一是 null

options 参数包含不支持的 exporterOptions。

适用于