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

JsonSchema4

public class JsonSchema4
A base class for describing a JSON schema.
public virtual JsonSchema4 ActualSchema { get; }

Gets the actual schema, either this or the reference schema.

public JsonSchema4 AdditionalItemsSchema { get; set; }

Gets or sets the schema for the additional items.

Gets or sets the schema for the additional properties.

public ICollection<JsonSchema4> AllOf { get; }

Gets the collection of schemas where each schema must be valid.

public bool AllowAdditionalItems { get; set; }

Gets or sets a value indicating whether additional items are allowed (default: true).

public bool AllowAdditionalProperties { get; set; }

Gets or sets a value indicating whether additional properties are allowed (default: true).

public ICollection<JsonSchema4> AnyOf { get; }

Gets the collection of schemas where at least one must be valid.

public object Default { get; set; }

Gets or sets the default value.

public IDictionary<string, JsonSchema4> Definitions { get; }

Gets the other schema definitions of this schema.

public string Description { get; set; }

Gets or sets the description.

public ICollection<object> Enumeration { get; }

Gets the collection of required properties.

public string Format { get; set; }

Gets or sets the format string.

public bool HasSchemaReference { get; }

Gets a value indicating whether this is a type reference.

public string Id { get; set; }

Gets or sets the id.

public bool IsDictionary { get; }

Gets a value indicating whether the schema represents a dictionary type (no properties and AdditionalProperties contains a schema).

public bool IsExclusiveMaximum { get; set; }

Gets or sets a value indicating whether the maximum value is excluded.

public bool IsExclusiveMinimum { get; set; }

Gets or sets a value indicating whether the minimum value is excluded.

public JsonSchema4 Item { get; set; }

Gets or sets the schema of an array item.

public ICollection<JsonSchema4> Items { get; }

Gets or sets the schema of an array item.

public double? Maximum { get; set; }

Gets or sets the maximum allowed value.

public int MaxItems { get; set; }

Gets or sets the maximum length of the array.

public int? MaxLength { get; set; }

Gets or sets the maximum length of the value string.

public int MaxProperties { get; set; }

Gets or sets the maximal number of allowed properties in an object.

public double? Minimum { get; set; }

Gets or sets the minimum allowed value.

public int MinItems { get; set; }

Gets or sets the minimum length of the array.

public int? MinLength { get; set; }

Gets or sets the minimum length of the value string.

public int MinProperties { get; set; }

Gets or sets the minimal number of allowed properties in an object.

public double? MultipleOf { get; set; }

Gets or sets the required multiple of for the number value.

public JsonSchema4 Not { get; set; }

Gets or sets the schema which must not be valid.

public ICollection<JsonSchema4> OneOf { get; }

Gets the collection of schemas where exactly one must be valid.

public virtual JsonSchema4 ParentSchema { get; }

Gets the parent schema of this schema.

public string Pattern { get; set; }

Gets or sets the validation pattern as regular expression.

public IDictionary<string, JsonProperty> PatternProperties { get; }

Gets the pattern properties of the type.

public IDictionary<string, JsonProperty> Properties { get; }

Gets the properties of the type.

public ICollection<string> RequiredProperties { get; }

Gets the collection of required properties.

public JsonSchema4 SchemaReference { get; set; }

Gets or sets the type reference.

public string SchemaVersion { get; set; }

Gets or sets the schema.

public string Title { get; set; }

Gets or sets the title.

public JsonObjectType Type { get; set; }

Gets the object type.

public string TypeName { get; set; }

Gets or sets the type name (class name of the object).

public bool UniqueItems { get; set; }

Gets or sets a value indicating whether the items in the array must be unique.

public JsonSchema4()

Initializes a new instance of the JsonSchema4 class.

Creates the type reference.

public static JsonSchema4 FromJson(string data)

Deserializes a JSON string to a JsonSchema4.

public static JsonSchema4 FromType<TType>()

Creates a JsonSchema4 from a given type.

public static JsonSchema4 FromType(Type type)

Creates a JsonSchema4 from a given type.

Finds the root parent of this schema.

public string ToJson()

Serializes the JsonSchema4 to a JSON string.

Validates the given JSON token against this schema.