JsonSchemaExporter.GetJsonSchemaAsNode 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions) |
產生對應特定合約元資料的 JSON 架構。 |
| GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions) |
產生對應指定類型的合約元資料的 JSON 架構。 |
GetJsonSchemaAsNode(JsonTypeInfo, JsonSchemaExporterOptions)
產生對應特定合約元資料的 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 物件。
傳回
一個定義 JsonNode JSON typeInfo架構的新實例。
例外狀況
其中一個指定的參數為 null。
該 typeInfo 參數包含不支援的 exporterOptions。
適用於
GetJsonSchemaAsNode(JsonSerializerOptions, Type, JsonSchemaExporterOptions)
產生對應指定類型的合約元資料的 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 物件。
傳回
一個定義 JsonNode JSON type架構的新實例。
例外狀況
其中一個指定的參數為 null。
該 options 參數包含不支援的 exporterOptions。