Merge pull request #32717 from chharvey/fix32249

[json-schema] allow `$schema` property to be string
This commit is contained in:
Pranav Senthilnathan
2019-02-01 12:37:52 -08:00
committed by GitHub
+38 -10
View File
@@ -20,6 +20,21 @@ export type JSONSchema4TypeName = 'string' | 'number' | 'integer' | 'boolean'
*/
export type JSONSchema4Type = any[] | boolean | number | null | object | string
/**
* Meta schema
*
* Recommended values:
* - '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#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema4Version = string;
/**
* JSON Schema V4
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
@@ -27,10 +42,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 +222,19 @@ export type JSONSchema6TypeName = 'string' | 'number' | 'integer' | 'boolean' |
export type JSONSchema6Type = any[] | boolean | number | null | object | string
/**
* Meta schema
*
* Recommended values:
* - '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#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema6Version = string;
/**
* JSON Schema V6
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01
@@ -218,8 +243,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.
@@ -502,12 +526,16 @@ export interface JSONSchema7Array extends Array<JSONSchema7Type> {}
/**
* Meta schema
*
* Recommended values:
* - '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#'
*
* @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 = string;
/**
* JSON Schema v7