/** * @see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-6.25 */ export type JSONSchemaPrimitiveType = 'null' | 'boolean' | 'object' | 'array' | 'number' | 'integer' | 'string'; export type JSONSchemaValue = null | boolean | { [key: string]: JSONSchemaValue; } | JSONSchemaValue[] | number | string; /** * @see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-4.4 */ export type JSONSchemaBooleanSchema = boolean; /** * JSON Schema Draft 06 * * @see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01 */ export type JSONSchema = JSONSchemaBooleanSchema | JSONSchemaObject; /** * JSON Schema Draft 06 * * @see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01 */ export interface JSONSchemaObject { $schema?: string; $id?: string; $ref?: ReferenceType extends string ? string : JSONSchema; $comment?: string; multipleOf?: number; maximum?: number; exclusiveMaximum?: number; minimum?: number; exclusiveMinimum?: number; maxLength?: number; minLength?: number; pattern?: string; additionalItems?: boolean | JSONSchema; items?: JSONSchema | JSONSchema[]; maxItems?: number; minItems?: number; uniqueItems?: boolean; contains?: JSONSchema; maxProperties?: number; minProperties?: number; required?: string[]; properties?: { [key: string]: JSONSchema; }; patternProperties?: { [key: string]: JSONSchema; }; additionalProperties?: boolean | JSONSchema; dependencies?: { [key: string]: JSONSchema | string[]; }; propertyNames?: JSONSchema; enum?: JSONSchemaValue[]; const?: JSONSchemaValue; type?: JSONSchemaPrimitiveType | JSONSchemaPrimitiveType[]; if?: JSONSchema; then?: JSONSchema; else?: JSONSchema; allOf?: [JSONSchema, ...JSONSchema[]]; anyOf?: [JSONSchema, ...JSONSchema[]]; oneOf?: [JSONSchema, ...JSONSchema[]]; not?: JSONSchema; definitions?: { [key: string]: JSONSchema; }; title?: string; description?: string; default?: JSONSchemaValue; readOnly?: boolean; writeOnly?: boolean; examples?: JSONSchemaValue[]; contentEncoding?: string; contentMediaType?: string; format?: string; /** * @see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-6.4 */ [key: string]: any; } export type DereferencedJSONSchema = JSONSchema;