From b414be80ddcb008689c0ed6976635a1b0239d711 Mon Sep 17 00:00:00 2001 From: Austin Wright Date: Tue, 29 Nov 2016 21:55:07 -0700 Subject: [PATCH] Core: Updates on boolean schema and $ref behavior --- jsonschema-core.xml | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index d4905e11..75eecd4a 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -189,30 +189,15 @@ A JSON Schema document, or simply a schema, is a JSON document used to describe an instance. A schema is itself interpreted as an instance. - A JSON Schema MUST be an object or a boolean, where boolean values are equivalent to object schemas as follows. + A JSON Schema MUST be an object or a boolean. + + + Boolean values are equivalent to the following behaviors: + + Always passes validation, as if the empty schema {} + Always fails validation, as if the schema { "not":{} } + -
- - true: - - - - -
-
- - false: - - - - -
Properties that are used to describe the instance are called keywords, or schema keywords. The meaning of properties is specified by the vocabulary that the schema is using. @@ -254,7 +239,7 @@ and the schema titled "root" is the root schema. - As with the root schema, a subschema MUST be an object or a boolean. + As with the root schema, a subschema is either an object or a boolean. @@ -324,9 +309,11 @@
- In addition to a boolean value or an object using schema kewyords defined - in the meta-schema, a schema may be represnted by an object containing a "$ref" property. - The value of the $ref is a URI Reference. + The "$ref" keyword is used to reference a schema, and provides the ability to validate recursive structures through self-reference. + + + An object schema with a "$ref" property MUST be interpreted as a "$ref" reference. + The value of the "$ref" property MUST be a URI Reference. Resolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object MUST be ignored.