From 514d7d9267f27f4209ce682487e3b96c8ba4ba50 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 11 Feb 2020 00:09:43 -0800 Subject: [PATCH] First pass a list of principles. These inform how JSON Schema is designed as a system. The section is placed after Definitions as otherwise the principles don't have clear meaning. --- jsonschema-core.xml | 64 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 19ef4c5e..ed2c1491 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -56,7 +56,7 @@ - + Internet Engineering Task Force JSON Schema @@ -455,6 +455,68 @@ +
+ + JSON Schema is built on several principles, which both explain various design + choices, and provide guidance on how to extend the specification effectively. + + + + + + All syntactically legal JSON documents with well-defined behavior are fully + supported as instance data. Notably, JSON objects with duplicate property + names are syntactically legal but not well-defined. + + + JSON Schema is defined over a data model, not JSON text. Therefore + JSON Schema can be used with any data format that can be reliably parsed + into the data model. + + + Locations in schemas and instances are always identified by URIs, + JSON Pointers, or Relative JSON Pointers. JSON Schema treats URIs as + identifiers only. Locating and retrieving URI-identified resources + is outside of the scope of this specification. + + + Schema URIs referenced or defined in JSON Schema's Core vocabulary MUST be + resolvable without instance data. + + + Once schema URIs are resolved, the result of applying a schema object + to instance data is data is a function of that schema object and its + dynamic-scope subschemas. Parent schemas have no effect on results. + + + Each keyword's behavior falls into one or more behavioral classifications. + A keyword's classification MUST be the same for all values of the keyword. + + + Keywords produce a boolean assertion result, and an annotation result that + can be of any type. Depending on the classification, the assertion result + might always be true, or the annotation result might always be empty. + + + Keyword results MAY be defined in terms of the results of other keywords + in the same schema object, as long as no cyclic dependencies are produced. + + + JSON Schema assertions form a constraint system. The empty schema, + {}, allows everything and constrains nothing. + Each assertion keyword adds constraints; keywords MUST NOT remove constraints. + + + JSON Schema annotations provide a flexible way to convey information for + an application to use. The information can be used with instance data, + or can be used directly from schemas to generate systems for use with + conforming instances. + + + +
+
In accordance with section 3.1 of ,