diff --git a/types/json-schema/index.d.ts b/types/json-schema/index.d.ts index 156a86c9a5..89f8d6ae9b 100644 --- a/types/json-schema/index.d.ts +++ b/types/json-schema/index.d.ts @@ -20,6 +20,15 @@ export type JSONSchema4TypeName = 'string' | 'number' | 'integer' | 'boolean' */ export type JSONSchema4Type = any[] | boolean | number | null | object | string +/** + * Meta schema + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema4Version = 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' + | 'http://json-schema.org/draft-04/schema#' | 'http://json-schema.org/draft-04/hyper-schema#' + | 'http://json-schema.org/draft-03/schema#' | 'http://json-schema.org/draft-03/hyper-schema#' + | string; + /** * JSON Schema V4 * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 @@ -27,10 +36,7 @@ export type JSONSchema4Type = any[] | boolean | number | null | object | string export interface JSONSchema4 { id?: string $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' - | 'http://json-schema.org/draft-04/schema#' | 'http://json-schema.org/draft-04/hyper-schema#' - | 'http://json-schema.org/draft-03/schema#' | 'http://json-schema.org/draft-03/hyper-schema#' - | string + $schema?: JSONSchema4Version /** * This attribute is a string that provides a short description of the @@ -210,6 +216,14 @@ export type JSONSchema6TypeName = 'string' | 'number' | 'integer' | 'boolean' | export type JSONSchema6Type = any[] | boolean | number | null | object | string +/** + * Meta schema + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema6Version = 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' + | 'http://json-schema.org/draft-06/schema#' | 'http://json-schema.org/draft-06/hyper-schema#' + | string; + /** * JSON Schema V6 * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 @@ -218,8 +232,7 @@ export type JSONSchema6Definition = JSONSchema6 | boolean; export interface JSONSchema6 { $id?: string $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' | - 'http://json-schema.org/draft-06/schema#' | 'http://json-schema.org/draft-06/hyper-schema#' + $schema?: JSONSchema6Version /** * Must be strictly greater than 0. @@ -504,10 +517,9 @@ export interface JSONSchema7Array extends Array {} * Meta schema * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 */ -export type JSONSchema7Version = 'http://json-schema.org/schema#' - | 'http://json-schema.org/hyper-schema#' - | 'http://json-schema.org/draft-07/schema#' - | 'http://json-schema.org/draft-07/hyper-schema#'; +export type JSONSchema7Version = 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' + | 'http://json-schema.org/draft-07/schema#' | 'http://json-schema.org/draft-07/hyper-schema#' + | string; /** * JSON Schema v7