* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
*/
export interface JSONSchema4 {
- id?: string;
- $ref?: string;
- $schema?: JSONSchema4Version;
+ id?: string | undefined;
+ $ref?: string | undefined;
+ $schema?: JSONSchema4Version | undefined;
/**
* This attribute is a string that provides a short description of the
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
*/
- title?: string;
+ title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
*/
- description?: string;
+ description?: string | undefined;
- default?: JSONSchema4Type;
- multipleOf?: number;
- maximum?: number;
- exclusiveMaximum?: boolean;
- minimum?: number;
- exclusiveMinimum?: boolean;
- maxLength?: number;
- minLength?: number;
- pattern?: string;
+ default?: JSONSchema4Type | undefined;
+ multipleOf?: number | undefined;
+ maximum?: number | undefined;
+ exclusiveMaximum?: boolean | undefined;
+ minimum?: number | undefined;
+ exclusiveMinimum?: boolean | undefined;
+ maxLength?: number | undefined;
+ minLength?: number | undefined;
+ pattern?: string | undefined;
/**
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
*/
- additionalItems?: boolean | JSONSchema4;
+ additionalItems?: boolean | JSONSchema4 | undefined;
/**
* This attribute defines the allowed items in an instance array, and
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
*/
- items?: JSONSchema4 | JSONSchema4[];
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
- maxItems?: number;
- minItems?: number;
- uniqueItems?: boolean;
- maxProperties?: number;
- minProperties?: number;
+ maxItems?: number | undefined;
+ minItems?: number | undefined;
+ uniqueItems?: boolean | undefined;
+ maxProperties?: number | undefined;
+ minProperties?: number | undefined;
/**
* This attribute indicates if the instance must have a value, and not
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
*/
- required?: false | string[];
+ required?: boolean | string[] | undefined;
/**
* This attribute defines a schema for all properties that are not
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
*/
- additionalProperties?: boolean | JSONSchema4;
+ additionalProperties?: boolean | JSONSchema4 | undefined;
definitions?: {
[k: string]: JSONSchema4;
- };
+ } | undefined;
/**
* This attribute is an object with property definitions that define the
*/
properties?: {
[k: string]: JSONSchema4;
- };
+ } | undefined;
/**
* This attribute is an object that defines the schema for a set of
*/
patternProperties?: {
[k: string]: JSONSchema4;
- };
+ } | undefined;
dependencies?: {
[k: string]: JSONSchema4 | string[];
- };
+ } | undefined;
/**
* This provides an enumeration of all possible values that are valid
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
*/
- enum?: JSONSchema4Type[];
+ enum?: JSONSchema4Type[] | undefined;
/**
* A single type, or a union of simple types
*/
- type?: JSONSchema4TypeName | JSONSchema4TypeName[];
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
- allOf?: JSONSchema4[];
- anyOf?: JSONSchema4[];
- oneOf?: JSONSchema4[];
- not?: JSONSchema4;
+ allOf?: JSONSchema4[] | undefined;
+ anyOf?: JSONSchema4[] | undefined;
+ oneOf?: JSONSchema4[] | undefined;
+ not?: JSONSchema4 | undefined;
/**
* The value of this property MUST be another schema which will provide
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
*/
- extends?: string | string[];
+ extends?: string | string[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
*/
[k: string]: any;
- format?: string;
+ format?: string | undefined;
}
//==================================================================================================
*/
export type JSONSchema6Definition = JSONSchema6 | boolean;
export interface JSONSchema6 {
- $id?: string;
- $ref?: string;
- $schema?: JSONSchema6Version;
+ $id?: string | undefined;
+ $ref?: string | undefined;
+ $schema?: JSONSchema6Version | undefined;
/**
* Must be strictly greater than 0.
* A numeric instance is valid only if division by this keyword's value results in an integer.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
*/
- multipleOf?: number;
+ multipleOf?: number | undefined;
/**
* Representing an inclusive upper limit for a numeric instance.
* This keyword validates only if the instance is less than or exactly equal to "maximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
*/
- maximum?: number;
+ maximum?: number | undefined;
/**
* Representing an exclusive upper limit for a numeric instance.
* This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
*/
- exclusiveMaximum?: number;
+ exclusiveMaximum?: number | undefined;
/**
* Representing an inclusive lower limit for a numeric instance.
* This keyword validates only if the instance is greater than or exactly equal to "minimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
*/
- minimum?: number;
+ minimum?: number | undefined;
/**
* Representing an exclusive lower limit for a numeric instance.
* This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
*/
- exclusiveMinimum?: number;
+ exclusiveMinimum?: number | undefined;
/**
* Must be a non-negative integer.
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
*/
- maxLength?: number;
+ maxLength?: number | undefined;
/**
* Must be a non-negative integer.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
*/
- minLength?: number;
+ minLength?: number | undefined;
/**
* Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
*/
- pattern?: string;
+ pattern?: string | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
*/
- items?: JSONSchema6Definition | JSONSchema6Definition[];
+ items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
*/
- additionalItems?: JSONSchema6Definition;
+ additionalItems?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
*/
- maxItems?: number;
+ maxItems?: number | undefined;
/**
* Must be a non-negative integer.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
*/
- minItems?: number;
+ minItems?: number | undefined;
/**
* If this keyword has boolean value false, the instance validates successfully.
* Omitting this keyword has the same behavior as a value of false.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
*/
- uniqueItems?: boolean;
+ uniqueItems?: boolean | undefined;
/**
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
*/
- contains?: JSONSchema6Definition;
+ contains?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
*/
- maxProperties?: number;
+ maxProperties?: number | undefined;
/**
* Must be a non-negative integer.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
*/
- minProperties?: number;
+ minProperties?: number | undefined;
/**
* Elements of this array must be unique.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
*/
- required?: string[];
+ required?: string[] | undefined;
/**
* This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
*/
properties?: {
[k: string]: JSONSchema6Definition;
- };
+ } | undefined;
/**
* This attribute is an object that defines the schema for a set of property names of an object instance.
*/
patternProperties?: {
[k: string]: JSONSchema6Definition;
- };
+ } | undefined;
/**
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
* The default value is an empty schema which allows any value for additional properties.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
*/
- additionalProperties?: JSONSchema6Definition;
+ additionalProperties?: JSONSchema6Definition | undefined;
/**
* This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
*/
dependencies?: {
[k: string]: JSONSchema6Definition | string[];
- };
+ } | undefined;
/**
* Takes a schema which validates the names of all properties rather than their values.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
*/
- propertyNames?: JSONSchema6Definition;
+ propertyNames?: JSONSchema6Definition | undefined;
/**
* This provides an enumeration of all possible values that are valid
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
*/
- enum?: JSONSchema6Type[];
+ enum?: JSONSchema6Type[] | undefined;
/**
* More readable form of a one-element "enum"
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
*/
- const?: JSONSchema6Type;
+ const?: JSONSchema6Type | undefined;
/**
* A single type, or a union of simple types
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
*/
- type?: JSONSchema6TypeName | JSONSchema6TypeName[];
+ type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
*/
- allOf?: JSONSchema6Definition[];
+ allOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
*/
- anyOf?: JSONSchema6Definition[];
+ anyOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
*/
- oneOf?: JSONSchema6Definition[];
+ oneOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
*/
- not?: JSONSchema6Definition;
+ not?: JSONSchema6Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
*/
definitions?: {
[k: string]: JSONSchema6Definition;
- };
+ } | undefined;
/**
* This attribute is a string that provides a short description of the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
- title?: string;
+ title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of purpose the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
- description?: string;
+ description?: string | undefined;
/**
* This keyword can be used to supply a default JSON value associated with a particular schema.
* It is RECOMMENDED that a default value be valid against the associated schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
*/
- default?: JSONSchema6Type;
+ default?: JSONSchema6Type | undefined;
/**
* Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
*/
- examples?: JSONSchema6Type[];
+ examples?: JSONSchema6Type[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
*/
- format?: string;
+ format?: string | undefined;
}
//==================================================================================================
*/
export type JSONSchema7Definition = JSONSchema7 | boolean;
export interface JSONSchema7 {
- $id?: string;
- $ref?: string;
- $schema?: JSONSchema7Version;
- $comment?: string;
+ $id?: string | undefined;
+ $ref?: string | undefined;
+ $schema?: JSONSchema7Version | undefined;
+ $comment?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
*/
- type?: JSONSchema7TypeName | JSONSchema7TypeName[];
- enum?: JSONSchema7Type[];
- const?: JSONSchema7Type;
+ type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
+ enum?: JSONSchema7Type[] | undefined;
+ const?: JSONSchema7Type | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
*/
- multipleOf?: number;
- maximum?: number;
- exclusiveMaximum?: number;
- minimum?: number;
- exclusiveMinimum?: number;
+ multipleOf?: number | undefined;
+ maximum?: number | undefined;
+ exclusiveMaximum?: number | undefined;
+ minimum?: number | undefined;
+ exclusiveMinimum?: number | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
*/
- maxLength?: number;
- minLength?: number;
- pattern?: string;
+ maxLength?: number | undefined;
+ minLength?: number | undefined;
+ pattern?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
*/
- items?: JSONSchema7Definition | JSONSchema7Definition[];
- additionalItems?: JSONSchema7Definition;
- maxItems?: number;
- minItems?: number;
- uniqueItems?: boolean;
- contains?: JSONSchema7;
+ items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
+ additionalItems?: JSONSchema7Definition | undefined;
+ maxItems?: number | undefined;
+ minItems?: number | undefined;
+ uniqueItems?: boolean | undefined;
+ contains?: JSONSchema7 | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
*/
- maxProperties?: number;
- minProperties?: number;
- required?: string[];
+ maxProperties?: number | undefined;
+ minProperties?: number | undefined;
+ required?: string[] | undefined;
properties?: {
[key: string]: JSONSchema7Definition;
- };
+ } | undefined;
patternProperties?: {
[key: string]: JSONSchema7Definition;
- };
- additionalProperties?: JSONSchema7Definition;
+ } | undefined;
+ additionalProperties?: JSONSchema7Definition | undefined;
dependencies?: {
[key: string]: JSONSchema7Definition | string[];
- };
- propertyNames?: JSONSchema7Definition;
+ } | undefined;
+ propertyNames?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
*/
- if?: JSONSchema7Definition;
- then?: JSONSchema7Definition;
- else?: JSONSchema7Definition;
+ if?: JSONSchema7Definition | undefined;
+ then?: JSONSchema7Definition | undefined;
+ else?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
*/
- allOf?: JSONSchema7Definition[];
- anyOf?: JSONSchema7Definition[];
- oneOf?: JSONSchema7Definition[];
- not?: JSONSchema7Definition;
+ allOf?: JSONSchema7Definition[] | undefined;
+ anyOf?: JSONSchema7Definition[] | undefined;
+ oneOf?: JSONSchema7Definition[] | undefined;
+ not?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
*/
- format?: string;
+ format?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
*/
- contentMediaType?: string;
- contentEncoding?: string;
+ contentMediaType?: string | undefined;
+ contentEncoding?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
*/
definitions?: {
[key: string]: JSONSchema7Definition;
- };
+ } | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
*/
- title?: string;
- description?: string;
- default?: JSONSchema7Type;
- readOnly?: boolean;
- writeOnly?: boolean;
- examples?: JSONSchema7Type;
+ title?: string | undefined;
+ description?: string | undefined;
+ default?: JSONSchema7Type | undefined;
+ readOnly?: boolean | undefined;
+ writeOnly?: boolean | undefined;
+ examples?: JSONSchema7Type | undefined;
}
export interface ValidationResult {