<PackageReference Include="NJsonSchema" Version="10.3.0" />

JsonSchemaSerialization

The JSON Schema serialization context holding information about the current serialization.
public static SchemaType CurrentSchemaType { get; }

Gets or sets the current schema type.

Gets the current serializer settings.

public static bool IsWriting { get; }

Gets or sets a value indicating whether the object is currently converted to JSON.

public static T FromJson<T>(string json, IContractResolver contractResolver)

Deserializes JSON data with the given contract resolver.

public static Task<T> FromJsonAsync<T>(string json, SchemaType schemaType, string documentPath, Func<T, JsonReferenceResolver> referenceResolverFactory, IContractResolver contractResolver)

Deserializes JSON data to a schema with reference handling.

public static Task<T> FromJsonAsync<T>(string json, SchemaType schemaType, string documentPath, Func<T, JsonReferenceResolver> referenceResolverFactory, IContractResolver contractResolver, CancellationToken cancellationToken = default)

Deserializes JSON data to a schema with reference handling.

public static string ToJson(object obj, SchemaType schemaType, IContractResolver contractResolver, Formatting formatting)

Serializes an object to a JSON string with reference handling.