简体   繁体   中英

Is there a schema for the JSON Schema draft 4 spec?

Is there a JSON schema that describes the JSON Schema draft 4 spec? Ie a schema that describes the format of the schema.

Yes. And it's referenced in the $schema property of JSON schemas:

"$schema": "http://json-schema.org/draft-04/schema#"

From the documentation :

The $schema keyword is both used as a JSON Schema version identifier and the location of a resource which is itself a JSON Schema, which describes any schema written for this particular version.

This keyword MUST be located at the root of a JSON Schema. The value of this keyword MUST be a URI [RFC3986] and a valid JSON Reference [json-reference]; this URI MUST be both absolute and normalized. The resource located at this URI MUST successfully describe itself. It is RECOMMENDED that schema authors include this keyword in their schemas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM