diff --git a/hyper-schema.json b/hyper-schema.json index b633bd50..2498b5e6 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft/hyper-schema#", - "id": "http://json-schema.org/draft/hyper-schema#", + "$id": "http://json-schema.org/draft/hyper-schema#", "title": "JSON Hyper-Schema", "definitions": { "schemaArray": { diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 9ee4bad0..cf9de1fe 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -347,23 +347,23 @@ -
+
- The "id" keyword defines a URI for the schema, + The "$id" keyword defines a URI for the schema, and the base URI that other URI references within the schema are resolved against. - The "id" keyword itself is resolved against the base URI that the object as a whole appears in. + The "$id" keyword itself is resolved against the base URI that the object as a whole appears in. If present, the value for this keyword MUST be a string, and MUST represent a valid URI-reference. This value SHOULD be normalized, and SHOULD NOT be an empty fragment <#> or an empty string <>. - The root schema of a JSON Schema document SHOULD contain an "id" keyword with an absolute-URI (containing a scheme, but no fragment). + The root schema of a JSON Schema document SHOULD contain an "$id" keyword with an absolute-URI (containing a scheme, but no fragment). To name subschemas in a JSON Schema document, - subschemas can use "id" to give themselves a document-local identifier. - This form of "id" keyword MUST begin with a hash ("#") to identify it as a fragment URI reference, + subschemas can use "$id" to give themselves a document-local identifier. + This form of "$id" keyword MUST begin with a hash ("#") to identify it as a fragment URI reference, followed by a letter ([A-Za-z]), followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), or periods ("."). @@ -374,18 +374,18 @@ Schemas can be identified by any URI that has been given to them, including a JSON Pointer or - their URI given directly by "id". + their URI given directly by "$id". - Tools SHOULD take note of the URIs that schemas, including subschemas, provide for themselves using "id". + Tools SHOULD take note of the URIs that schemas, including subschemas, provide for themselves using "$id". This is known as "Internal referencing". @@ -426,14 +426,14 @@ - When an implementation encounters the <#/definitions/single> schema, it resolves the "id" URI reference + When an implementation encounters the <#/definitions/single> schema, it resolves the "$id" URI reference against the current base URI to form <http://example.net/root.json#item>. @@ -458,7 +458,7 @@ Implementations SHOULD be able to associate arbitrary URIs with an arbitrary schema and/or - automatically associate a schema's "id"-given URI, depending on the trust that the the validator + automatically associate a schema's "$id"-given URI, depending on the trust that the the validator has in the schema. @@ -587,7 +587,7 @@ User-Agent: so-cool-json-schema/1.0.2 curl/7.43.0 Validators MUST NOT fall into an infinite loop. - Servers need to take care that malicious parties can't change the functionality of existing schemas by uploading a schema with an pre-existing or very similar "id". + Servers need to take care that malicious parties can't change the functionality of existing schemas by uploading a schema with an pre-existing or very similar "$id". Individual JSON Schema vocabularies are liable to also have their own security considerations. Consult the respective specifications for more information. @@ -681,6 +681,7 @@ User-Agent: so-cool-json-schema/1.0.2 curl/7.43.0 Updated intro Allowed for any schema to be a boolean + Changed "id" to "$id"; all core keywords prefixed with "$" diff --git a/links.json b/links.json index 3c9cd1c6..fad6e894 100644 --- a/links.json +++ b/links.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft/hyper-schema#", - "id": "http://json-schema.org/draft/links#", + "$id": "http://json-schema.org/draft/links#", "title": "Link Description Object", "type": "object", "required": [ "href" ], diff --git a/schema.json b/schema.json index 15502e9b..804d79d6 100644 --- a/schema.json +++ b/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft/schema#", - "id": "http://json-schema.org/draft/schema#", + "$id": "http://json-schema.org/draft/schema#", "title": "Core schema meta-schema", "definitions": { "schemaArray": { @@ -37,7 +37,7 @@ }, "type": ["object", "boolean"], "properties": { - "id": { + "$id": { "type": "string", "format": "uriref" },