JsonSchema type is a union of both versions.
JsonSchema
Union type for JSON Schema Draft 4 and Draft 7.Main type that accepts either JSON Schema Draft 4 or Draft 7 schemas.
JsonSchema7
JSON Schema Draft 7 specification interface.Schema metadata
Schema identifier. Tells references where the root of the document is located.
Meta-schema URL. Recommended to include in the root of any JSON Schema.
Reference to another schema or schema definition.
Human-readable title of the schema.
Detailed description of the schema.
Default value for the data represented by this schema.
Type definition
The basic type of this schema. Can be one of:
string, number, integer, object, array, boolean, null, or an array of these types.Enumerates the allowed values for this schema.
Specifies a single constant value that the data must match.
Number validation
The value must be a multiple of this number (e.g., 10 is a multiple of 5).
Maximum value allowed (inclusive).
Maximum value allowed (exclusive). Value must be less than this number.
Minimum value allowed (inclusive).
Minimum value allowed (exclusive). Value must be greater than this number.
String validation
Maximum length of the string.
Minimum length of the string.
Regular expression pattern that the string must match.
String format identifier (e.g.,
date, time, date-time, email, uri).Array validation
Schema for array items. Can be a single schema or an array of schemas for tuple validation.
Schema for additional items beyond those defined in
items array.Maximum number of items in the array.
Minimum number of items in the array.
Whether all items in the array must be unique.
Schema that at least one array item must match.
Object validation
Map of property names to their schemas.
Map of regex patterns to schemas. Properties matching the pattern must validate against the schema.
Schema for properties not defined in
properties or patternProperties. If false, no additional properties are allowed.Array of property names that must be present.
Schema that all property names must match.
Maximum number of properties allowed.
Minimum number of properties required.
Defines dependencies between properties. Value can be an array of required property names or a schema that must validate when the key property is present.
Schema composition
Data must validate against all of the schemas in this array.
Data must validate against at least one of the schemas in this array.
Data must validate against exactly one of the schemas in this array.
Data must not validate against this schema.
Conditional schemas
Conditional schema. If data validates against this schema, apply the
then schema.Schema to apply if the
if condition is true.Schema to apply if the
if condition is false.Schema reuse
Container for reusable schema definitions. Reference with
$ref.Additional properties
Indicates the value should not be modified.
Indicates the value may be set but should not be retrieved.
Array of example values for documentation.
Custom error message for validation failures.
JsonSchema4
JSON Schema Draft 4 specification interface. Similar to Draft 7 with key differences:Key differences from Draft 7
- Uses
idinstead of$idfor schema identifier exclusiveMaximumandexclusiveMinimumarebooleaninstead ofnumber- Does not support:
const,contains,propertyNames,if/then/else,readOnly,writeOnly,examples
Most JSON Forms projects use JSON Schema Draft 7. Draft 4 support is maintained for backward compatibility.