JsonSchema4
public class JsonSchema4 : JsonReferenceBase<JsonSchema4>, IDocumentPathProvider, IJsonReference, IJsonReferenceBase, IJsonExtensionObject
A base class for describing a JSON schema.
Gets the NJsonSchema toolchain version.
Gets the discriminator property (Swagger only).
Gets the actual resolved discriminator of this schema (no inheritance, OpenApi only).
Gets all properties of this schema (i.e. all direct properties and properties from the schemas in allOf which do not have a type).
Gets the actual schema, either this or the referenced schema.
Gets the type actual schema (e.g. the shared schema of a property, parameter, etc.).
Gets or sets the schema for the additional items.
Gets or sets the schema for the additional properties.
Gets the list of all inherited/parent schemas.
Gets the collection of schemas where each schema must be valid.
Gets or sets a value indicating whether additional items are allowed (default: true).
Gets or sets a value indicating whether additional properties are allowed (default: true).
Gets the collection of schemas where at least one must be valid.
Gets or sets the default value.
Gets the other schema definitions of this schema.
Gets or sets the description.
Gets or sets the dictionary key schema (x-key, only enum schemas are allowed).
Gets or sets the discriminator property (Swagger only, should not be used in internal tooling).
Gets or sets the discriminator of this schema (OpenApi only).
Gets the collection of required properties.
Gets or sets the enumeration names (optional, draft v5).
Gets or sets the enumeration names (optional, draft v5).
Gets or sets the example (Swagger and Open API only).
Gets or sets the exclusive maximum value (v6).
Gets or sets the exclusive minimum value (v6).
Gets or sets the extension data (i.e. additional properties which are not directly defined by JSON Schema).
Gets or sets the format string.
Gets a value indicating whether this is an allOf schema reference.
Gets a value indicating whether this is an oneOf schema reference.
Gets a value indicating whether this is a schema reference ($ref, HasAllOfSchemaReference or HasOneOfSchemaReference).
Gets a value indicating whether this is a schema reference ($ref, HasAllOfSchemaReference or HasOneOfSchemaReference).
Gets a value indicating whether the schema title can be used as type name.
Gets or sets the id.
Gets the inherited/parent schema (most probable base schema in allOf).
Gets the inherited/parent schema which may also be inlined
(the schema itself if it is a dictionary or array, otherwise InheritedSchema).
Gets or sets a value indicating whether the type is abstract, i.e. cannot be instantiated directly (x-abstract).
Gets a value indicating whether this is any type (e.g. any in TypeScript or object in CSharp).
Gets a value indicating whether the schema represents an array type (an array where each item has the same type).
Gets a value indicating whether the schema is binary (file or binary format).
Gets or sets a value indicating whether the schema is deprecated (Swagger and Open API only).
Gets a value indicating whether the schema represents a dictionary type (no properties and AdditionalProperties or PatternProperties contain a schema).
Gets a value indicating whether this is enumeration.
Gets or sets a value indicating whether the minimum value is excluded (v4).
Gets or sets a value indicating whether the minimum value is excluded (v4).
Gets or sets a value indicating this is an bit flag enum (custom extension, sets 'x-enumFlags', default: false).
Gets or sets a value indicating whether the schema is nullable (Open API only).
Gets a value indicating whether the schema describes an object.
Gets a value indicating whether the schema represents an tuple type (an array where each item may have a different type).
Gets or sets the schema of an array item.
Gets or sets the schemas of the array's tuple values.
Gets or sets the maximum allowed value.
Gets or sets the maximum length of the array.
Gets or sets the maximum length of the value string.
Gets or sets the maximal number of allowed properties in an object.
Gets or sets the minimum allowed value.
Gets or sets the minimum length of the array.
Gets or sets the minimum length of the value string.
Gets or sets the minimal number of allowed properties in an object.
Gets or sets the required multiple of for the number value.
Gets or sets the schema which must not be valid.
Gets the collection of schemas where exactly one must be valid.
Gets the parent schema of this schema.
Gets the parent schema of this schema.
Gets or sets the validation pattern as regular expression.
Gets the pattern properties of the type.
Gets the properties of the type.
Gets the collection of required properties.
Gets the discriminator or discriminator of an inherited schema (or null).
Gets or sets the type reference.
Gets or sets the schema.
Gets or sets the title.
Gets the object types (as enum flags).
Gets or sets a value indicating whether the items in the array must be unique.
Gets the xml object of the schema (used in Swagger specifications).
public JsonSchema4()
Initializes a new instance of the JsonSchema4 class.
Creates a schema which matches any data.
Creates a schema which matches any data.
public static PropertyRenameAndIgnoreSerializerContractResolver CreateJsonSerializerContractResolver(SchemaType schemaType)
Creates the serializer contract resolver based on the SchemaType.
Loads a JSON Schema from a given file path (only available in .NET 4.x).
public static Task<JsonSchema4> FromFileAsync(string filePath, Func<JsonSchema4, JsonReferenceResolver> referenceResolverFactory)
Loads a JSON Schema from a given file path (only available in .NET 4.x).
Deserializes a JSON string to a JsonSchema4.
Deserializes a JSON string to a JsonSchema4.
public static Task<JsonSchema4> FromJsonAsync(string data, string documentPath, Func<JsonSchema4, JsonReferenceResolver> referenceResolverFactory)
Deserializes a JSON string to a JsonSchema4.
Creates a JsonSchema4 from sample JSON data.
Creates a JsonSchema4 from a given type.
Creates a JsonSchema4 from a given type.
Creates a JsonSchema4 from a given type.
Creates a JsonSchema4 from a given type.
Loads a JSON Schema from a given URL (only available in .NET 4.x).
public static Task<JsonSchema4> FromUrlAsync(string url, Func<JsonSchema4, JsonReferenceResolver> referenceResolverFactory)
Loads a JSON Schema from a given URL (only available in .NET 4.x).
Determines whether the given schema is the parent schema of this schema (i.e. super/base class).
Gets a value indicating whether this schema inherits from the given parent schema.
Gets a value indicating whether the validated data can be null.
Serializes the JsonSchema4 to a JSON string.
Serializes the JsonSchema4 to a JSON string.
Validates the given JSON data against this schema.
Validates the given JSON token against this schema.