Home JsonSchemaJsonConverter Class
JsonSchemaJsonConverter Class
Cancel

JsonSchemaJsonConverter Class

Namespace: Json.Schema

Inheritance: JsonSchemaJsonConverter 🡒 JsonConverter<JsonSchema> 🡒 JsonConverter 🡒 object

Provides custom serialization and deserialization logic for Json.Schema.JsonSchema objects when using System.Text.Json.

Remarks

Use this converter to enable reading and writing of Json.Schema.JsonSchema instances with

Properties

NameTypeSummary
HandleNullbool 
TypeType 

Methods

Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Deserializes a JSON value from the specified reader into a Json.Schema.JsonSchema instance.

Declaration

1
public override JsonSchema Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
ParameterTypeDescription
readerref Utf8JsonReaderThe System.Text.Json.Utf8JsonReader positioned at the JSON value to read. The reader must be at the start of a valid
typeToConvertTypeThe type to convert the JSON value to. This parameter is ignored; the method always returns a Json.Schema.JsonSchema.
optionsJsonSerializerOptionsThe serializer options to use when reading the JSON value. Must not be <see langword=”null” />.

Returns

A Json.Schema.JsonSchema instance representing the deserialized schema, or if the JSON

Write(Utf8JsonWriter writer, JsonSchema value, JsonSerializerOptions options)

Writes the specified JSON schema to the provided writer using the given serializer options.

Declaration

1
public override void Write(Utf8JsonWriter writer, JsonSchema value, JsonSerializerOptions options)
ParameterTypeDescription
writerUtf8JsonWriterThe writer to which the JSON schema will be written. Must not be null.
valueJsonSchemaThe JSON schema to write. Must not be null.
optionsJsonSerializerOptionsThe serializer options to use when writing the JSON schema. Must not be null.
Contents