/** * Represents a JSON Schema based on Draft 2020-12. */ export interface JsonSchema { /** The unique identifier for the schema. */ $id?: string; /** The meta-schema defining the rules for this schema. */ $schema?: string; /** A reference to another schema, used for reuse and modularization. */ $ref?: string; /** Defines reusable schema components. Replaces definitions from Draft 07. */ $defs?: { [key: string]: JsonSchema; }; /** Specifies the expected data type. */ type?: "string" | "number" | "integer" | "boolean" | "array" | "object" | "null"; /** A human-readable title for the schema. */ title?: string; /** A detailed description of the schema's purpose. */ description?: string; /** The default value if no value is provided. */ default?: any; /** Example values to demonstrate valid instances. */ examples?: any[]; /** A list of specific allowed values. */ enum?: any[]; /** Specifies a single constant value allowed in the schema. */ const?: any; /** Minimum length of a string. */ minLength?: number; /** Maximum length of a string. */ maxLength?: number; /** Regular expression pattern that the string must match. */ pattern?: string; /** String format validation (e.g., date-time, email, uri). */ format?: string; /** The minimum allowed value for numbers. */ minimum?: number; /** The maximum allowed value for numbers. */ maximum?: number; /** Specifies an exclusive minimum (value must be strictly greater). */ exclusiveMinimum?: number; /** Specifies an exclusive maximum (value must be strictly less). */ exclusiveMaximum?: number; /** Requires the number to be a multiple of a given value. */ multipleOf?: number; /** Defines the properties of an object. */ properties?: { [key: string]: JsonSchema; }; /** Specifies required properties within an object. */ required?: string[]; /** Determines if additional properties are allowed, or defines their schema. */ additionalProperties?: boolean | JsonSchema; /** Prevents extra properties if not defined in properties. */ unevaluatedProperties?: boolean | JsonSchema; /** Defines the type(s) of items allowed in an array. */ items?: JsonSchema | JsonSchema[]; /** Minimum number of items in an array. */ minItems?: number; /** Maximum number of items in an array. */ maxItems?: number; /** Ensures all items in the array are unique. */ uniqueItems?: boolean; /** Schema applied when a condition is met. */ if?: JsonSchema; /** Schema applied if if condition passes. */ then?: JsonSchema; /** Schema applied if if condition fails. */ else?: JsonSchema; /** Specifies required properties if a certain property exists. */ dependentRequired?: { [key: string]: string[]; }; /** Specifies a schema that must be applied if a property exists. */ dependentSchemas?: { [key: string]: JsonSchema; }; /** Requires all schemas in this array to be valid. */ allOf?: JsonSchema[]; /** Requires at least one schema in this array to be valid. */ anyOf?: JsonSchema[]; /** Requires exactly one schema in this array to be valid. */ oneOf?: JsonSchema[]; /** Defines a schema that must not be valid. */ not?: JsonSchema; /** Specifies the encoding for file contents (e.g., base64). */ contentEncoding?: string; /** Specifies the media type (MIME type) of file contents. */ contentMediaType?: string; }