From 340d8c24af4d1cbf6cee30349e1f18c3265027d4 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 4 Nov 2024 17:08:45 -0400 Subject: [PATCH] Outline JSON Schema Draft 7 Signed-off-by: Juan Cruz Viotti --- content/draft7/_index.markdown | 21 +++++++ content/draft7/core/_index.markdown | 18 ++++++ content/draft7/core/comment.markdown | 12 ++++ content/draft7/core/id.markdown | 20 +++++++ content/draft7/core/ref.markdown | 26 +++++++++ content/draft7/core/schema.markdown | 19 +++++++ content/draft7/validation/_index.markdown | 20 +++++++ .../validation/additionalItems.markdown | 28 ++++++++++ .../validation/additionalProperties.markdown | 32 +++++++++++ content/draft7/validation/allOf.markdown | 29 ++++++++++ content/draft7/validation/anyOf.markdown | 29 ++++++++++ content/draft7/validation/const.markdown | 19 +++++++ content/draft7/validation/contains.markdown | 27 +++++++++ .../validation/contentEncoding.markdown | 17 ++++++ .../validation/contentMediaType.markdown | 17 ++++++ content/draft7/validation/default.markdown | 25 +++++++++ .../draft7/validation/definitions.markdown | 19 +++++++ .../draft7/validation/dependencies.markdown | 25 +++++++++ .../draft7/validation/description.markdown | 23 ++++++++ content/draft7/validation/else.markdown | 30 ++++++++++ content/draft7/validation/enum.markdown | 23 ++++++++ content/draft7/validation/examples.markdown | 25 +++++++++ .../validation/exclusiveMaximum.markdown | 25 +++++++++ .../validation/exclusiveMinimum.markdown | 25 +++++++++ content/draft7/validation/format.markdown | 18 ++++++ content/draft7/validation/if.markdown | 28 ++++++++++ content/draft7/validation/items.markdown | 33 +++++++++++ content/draft7/validation/maxItems.markdown | 23 ++++++++ content/draft7/validation/maxLength.markdown | 21 +++++++ .../draft7/validation/maxProperties.markdown | 23 ++++++++ content/draft7/validation/maximum.markdown | 23 ++++++++ content/draft7/validation/minItems.markdown | 25 +++++++++ content/draft7/validation/minLength.markdown | 23 ++++++++ .../draft7/validation/minProperties.markdown | 25 +++++++++ content/draft7/validation/minimum.markdown | 23 ++++++++ content/draft7/validation/multipleOf.markdown | 25 +++++++++ content/draft7/validation/not.markdown | 29 ++++++++++ content/draft7/validation/oneOf.markdown | 29 ++++++++++ content/draft7/validation/pattern.markdown | 25 +++++++++ .../validation/patternProperties.markdown | 34 +++++++++++ content/draft7/validation/properties.markdown | 32 +++++++++++ .../draft7/validation/propertyNames.markdown | 29 ++++++++++ content/draft7/validation/readOnly.markdown | 25 +++++++++ content/draft7/validation/required.markdown | 25 +++++++++ content/draft7/validation/then.markdown | 29 ++++++++++ content/draft7/validation/title.markdown | 23 ++++++++ content/draft7/validation/type.markdown | 18 ++++++ .../draft7/validation/uniqueItems.markdown | 23 ++++++++ content/draft7/validation/writeOnly.markdown | 25 +++++++++ layouts/_default/section.html | 56 ++++++++++--------- layouts/partials/dialect-badge.html | 5 +- layouts/partials/sidebar.html | 2 +- 52 files changed, 1225 insertions(+), 28 deletions(-) create mode 100644 content/draft7/_index.markdown create mode 100644 content/draft7/core/_index.markdown create mode 100644 content/draft7/core/comment.markdown create mode 100644 content/draft7/core/id.markdown create mode 100644 content/draft7/core/ref.markdown create mode 100644 content/draft7/core/schema.markdown create mode 100644 content/draft7/validation/_index.markdown create mode 100644 content/draft7/validation/additionalItems.markdown create mode 100644 content/draft7/validation/additionalProperties.markdown create mode 100644 content/draft7/validation/allOf.markdown create mode 100644 content/draft7/validation/anyOf.markdown create mode 100644 content/draft7/validation/const.markdown create mode 100644 content/draft7/validation/contains.markdown create mode 100644 content/draft7/validation/contentEncoding.markdown create mode 100644 content/draft7/validation/contentMediaType.markdown create mode 100644 content/draft7/validation/default.markdown create mode 100644 content/draft7/validation/definitions.markdown create mode 100644 content/draft7/validation/dependencies.markdown create mode 100644 content/draft7/validation/description.markdown create mode 100644 content/draft7/validation/else.markdown create mode 100644 content/draft7/validation/enum.markdown create mode 100644 content/draft7/validation/examples.markdown create mode 100644 content/draft7/validation/exclusiveMaximum.markdown create mode 100644 content/draft7/validation/exclusiveMinimum.markdown create mode 100644 content/draft7/validation/format.markdown create mode 100644 content/draft7/validation/if.markdown create mode 100644 content/draft7/validation/items.markdown create mode 100644 content/draft7/validation/maxItems.markdown create mode 100644 content/draft7/validation/maxLength.markdown create mode 100644 content/draft7/validation/maxProperties.markdown create mode 100644 content/draft7/validation/maximum.markdown create mode 100644 content/draft7/validation/minItems.markdown create mode 100644 content/draft7/validation/minLength.markdown create mode 100644 content/draft7/validation/minProperties.markdown create mode 100644 content/draft7/validation/minimum.markdown create mode 100644 content/draft7/validation/multipleOf.markdown create mode 100644 content/draft7/validation/not.markdown create mode 100644 content/draft7/validation/oneOf.markdown create mode 100644 content/draft7/validation/pattern.markdown create mode 100644 content/draft7/validation/patternProperties.markdown create mode 100644 content/draft7/validation/properties.markdown create mode 100644 content/draft7/validation/propertyNames.markdown create mode 100644 content/draft7/validation/readOnly.markdown create mode 100644 content/draft7/validation/required.markdown create mode 100644 content/draft7/validation/then.markdown create mode 100644 content/draft7/validation/title.markdown create mode 100644 content/draft7/validation/type.markdown create mode 100644 content/draft7/validation/uniqueItems.markdown create mode 100644 content/draft7/validation/writeOnly.markdown diff --git a/content/draft7/_index.markdown b/content/draft7/_index.markdown new file mode 100644 index 0000000..773f44b --- /dev/null +++ b/content/draft7/_index.markdown @@ -0,0 +1,21 @@ +--- +title: "Draft 7" +description: "JSON Schema: A Media Type for Describing JSON Documents" +summary: "JSON Schema Draft 7 is a JSON media type for defining the structure of JSON data. JSON Schema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data." +organization: JSON Schema +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01" +authors: + - github: awwright + first: Austin + last: Wright + - github: handrews + first: Henry + last: Andrews + - github: geraintluff + first: Geraint + last: Luff +metaschema: "http://json-schema.org/draft-07/schema#" +year: 2018 +bowtie: "https://bowtie.report/#/dialects/draft7" +release_notes: "https://json-schema.org/draft-07/json-schema-release-notes" +--- diff --git a/content/draft7/core/_index.markdown b/content/draft7/core/_index.markdown new file mode 100644 index 0000000..7879b09 --- /dev/null +++ b/content/draft7/core/_index.markdown @@ -0,0 +1,18 @@ +--- +title: "Core" +summary: "The vocabulary that defines JSON Schema core terminology and mechanisms, including pointing to another JSON Schema by reference, dereferencing a JSON Schema reference, and specifying the vocabulary being used." +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01" +authors: + - github: awwright + first: Austin + last: Wright + - github: handrews + first: Henry + last: Andrews +uri: "https://json-schema.org/draft-07/draft-handrews-json-schema-01" +metaschema: "http://json-schema.org/draft-07/schema#" +official: true +default: true +mandatory: true +index: -99999 +--- diff --git a/content/draft7/core/comment.markdown b/content/draft7/core/comment.markdown new file mode 100644 index 0000000..5add428 --- /dev/null +++ b/content/draft7/core/comment.markdown @@ -0,0 +1,12 @@ +--- +keyword: "$comment" +signature: "String" +value: This keyword must be set to a string +summary: "This keyword reserves a location for comments from schema authors to readers or maintainers of the schema." +kind: [ "location" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01#rfc.section.9" +metaschema: "http://json-schema.org/draft-07/schema#" +introduced_in: draft7 +index: -9 +--- diff --git a/content/draft7/core/id.markdown b/content/draft7/core/id.markdown new file mode 100644 index 0000000..e4d79d5 --- /dev/null +++ b/content/draft7/core/id.markdown @@ -0,0 +1,20 @@ +--- +keyword: "$id" +signature: "URI Reference" +value: This keyword must be set to an absolute URI or a relative reference as defined by [RFC 3986](https://www.rfc-editor.org/info/rfc3986) +summary: "This keyword declares an identifier for the schema resource." +kind: [ "identifier" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01#rfc.section.8.2" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/optional/id.json +index: -999 +introduced_in: draft6 +affects: + - vocabulary: core + keyword: $ref +related: + - vocabulary: core + keyword: $schema +--- diff --git a/content/draft7/core/ref.markdown b/content/draft7/core/ref.markdown new file mode 100644 index 0000000..24295a4 --- /dev/null +++ b/content/draft7/core/ref.markdown @@ -0,0 +1,26 @@ +--- +keyword: "$ref" +signature: "URI Reference" +value: This keyword must be set to an absolute URI or a relative reference as defined by [RFC 3986](https://www.rfc-editor.org/info/rfc3986), where its fragment (if any) can consist of a JSON Pointer as defined by [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) +summary: "This keyword is used to reference a statically identified schema." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01#rfc.section.8.3" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/ref.json + - draft7/refRemote.json + - draft7/infinite-loop-detection.json + - draft7/optional/unknownKeyword.json + - draft7/optional/cross-draft.json +index: -99 +introduced_in: draft3 +changed_in: + - draft6 +interdependencies: + - vocabulary: core + keyword: $id +related: + - vocabulary: validation + keyword: definitions +--- diff --git a/content/draft7/core/schema.markdown b/content/draft7/core/schema.markdown new file mode 100644 index 0000000..106d3e6 --- /dev/null +++ b/content/draft7/core/schema.markdown @@ -0,0 +1,19 @@ +--- +keyword: "$schema" +signature: "URI" +value: This keyword must be set to an absolute URI as defined by [RFC 3986](https://www.rfc-editor.org/info/rfc3986) +summary: "This keyword is both used as a JSON Schema dialect identifier and as a reference to a JSON Schema which describes the set of valid schemas written for this particular dialect." +kind: [ "identifier" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-01#rfc.section.7" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + description: Implementation dependent +index: -999 +introduced_in: draft3 +related: + - vocabulary: core + keyword: $id + - vocabulary: validation + keyword: definitions +--- diff --git a/content/draft7/validation/_index.markdown b/content/draft7/validation/_index.markdown new file mode 100644 index 0000000..4e8d6bf --- /dev/null +++ b/content/draft7/validation/_index.markdown @@ -0,0 +1,20 @@ +--- +title: "Validation" +summary: "A vocabulary that defines keywords that impose requirements for successful validation of an instance." +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01" +authors: + - github: awwright + first: Austin + last: Wright + - github: handrews + first: Henry + last: Andrews + - github: geraintluff + first: Geraint + last: Luff +uri: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01" +metaschema: "http://json-schema.org/draft-07/schema#" +official: true +default: true +index: -999 +--- diff --git a/content/draft7/validation/additionalItems.markdown b/content/draft7/validation/additionalItems.markdown new file mode 100644 index 0000000..ead1442 --- /dev/null +++ b/content/draft7/validation/additionalItems.markdown @@ -0,0 +1,28 @@ +--- +keyword: "additionalItems" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "If [`items`](/draft7/applicator/items) is set to an array of schemas, validation succeeds if each element of the instance not covered by it validates against this schema." +kind: [ "applicator" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.2" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +tests: + - draft7/additionalItems.json +index: -98 +introduced_in: draft3 +interdependencies: + - vocabulary: validation + keyword: items + - vocabulary: validation + keyword: minItems + - vocabulary: validation + keyword: maxItems +related: + - vocabulary: validation + keyword: contains + - vocabulary: validation + keyword: uniqueItems +--- diff --git a/content/draft7/validation/additionalProperties.markdown b/content/draft7/validation/additionalProperties.markdown new file mode 100644 index 0000000..5549260 --- /dev/null +++ b/content/draft7/validation/additionalProperties.markdown @@ -0,0 +1,32 @@ +--- +keyword: "additionalProperties" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "Validation succeeds if the schema validates against each value not matched by other object applicators in this vocabulary." +kind: [ "applicator" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.6" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/additionalProperties.json +default: + value: "{}" +introduced_in: draft1 +index: -4 +interdependencies: + - vocabulary: validation + keyword: properties + - vocabulary: validation + keyword: patternProperties +related: + - vocabulary: validation + keyword: dependencies + - vocabulary: validation + keyword: propertyNames + - vocabulary: validation + keyword: required + - vocabulary: validation + keyword: minProperties + - vocabulary: validation + keyword: maxProperties +--- diff --git a/content/draft7/validation/allOf.markdown b/content/draft7/validation/allOf.markdown new file mode 100644 index 0000000..f20f9f0 --- /dev/null +++ b/content/draft7/validation/allOf.markdown @@ -0,0 +1,29 @@ +--- +keyword: "allOf" +signature: "Array" +value: This keyword must be set to a *non-empty* array, where each item is a valid JSON Schema +summary: "An instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword's value." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.7.1" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + logical_value: "[]" +tests: + - draft7/allOf.json +index: 6 +introduced_in: draft4 +related: + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: if + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/anyOf.markdown b/content/draft7/validation/anyOf.markdown new file mode 100644 index 0000000..cf4b983 --- /dev/null +++ b/content/draft7/validation/anyOf.markdown @@ -0,0 +1,29 @@ +--- +keyword: "anyOf" +signature: "Array" +value: This keyword must be set to a *non-empty* array, where each item is a valid JSON Schema +summary: "An instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword's value." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.7.2" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + logical_value: "[]" +tests: + - draft7/anyOf.json +index: 7 +introduced_in: draft4 +related: + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: if + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/const.markdown b/content/draft7/validation/const.markdown new file mode 100644 index 0000000..a70abf1 --- /dev/null +++ b/content/draft7/validation/const.markdown @@ -0,0 +1,19 @@ +--- +keyword: "const" +signature: "Any" +value: This keyword must be set to a JSON value +summary: "Validation succeeds if the instance is equal to this keyword's value." +kind: [ "assertion" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.1.3" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/const.json +introduced_in: draft6 +index: -99997 +related: + - vocabulary: validation + keyword: enum + - vocabulary: validation + keyword: type +--- diff --git a/content/draft7/validation/contains.markdown b/content/draft7/validation/contains.markdown new file mode 100644 index 0000000..716e52c --- /dev/null +++ b/content/draft7/validation/contains.markdown @@ -0,0 +1,27 @@ +--- +keyword: "contains" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "Validation succeeds if the instance contains an element that validates against this schema." +kind: [ "applicator" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.6" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/contains.json +default: + value: "{}" +introduced_in: draft6 +index: -94 +related: + - vocabulary: validation + keyword: items + - vocabulary: validation + keyword: additionalItems + - vocabulary: validation + keyword: minItems + - vocabulary: validation + keyword: maxItems + - vocabulary: validation + keyword: uniqueItems +--- diff --git a/content/draft7/validation/contentEncoding.markdown b/content/draft7/validation/contentEncoding.markdown new file mode 100644 index 0000000..0a1e5b4 --- /dev/null +++ b/content/draft7/validation/contentEncoding.markdown @@ -0,0 +1,17 @@ +--- +keyword: "contentEncoding" +signature: "String" +value: This keyword should be set to a standard (to increase interoperability) encoding name such as those defined in [RFC 4648](https://www.rfc-editor.org/info/rfc4686) +summary: "The string instance should be interpreted as encoded binary data and decoded using the encoding named by this property." +kind: [ "annotation" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.8.3" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/optional/content.json +introduced_in: draft7 +index: 98 +related: + - vocabulary: validation + keyword: contentMediaType +--- diff --git a/content/draft7/validation/contentMediaType.markdown b/content/draft7/validation/contentMediaType.markdown new file mode 100644 index 0000000..21053fe --- /dev/null +++ b/content/draft7/validation/contentMediaType.markdown @@ -0,0 +1,17 @@ +--- +keyword: "contentMediaType" +signature: "String" +value: This keyword should be set to a valid media type as defined in [RFC 2046](https://www.rfc-editor.org/rfc/rfc2046.html), like the registered [IANA](https://www.iana.org/assignments/media-types/media-types.xhtml) media types +summary: "This keyword declares the media type of the string instance." +kind: [ "annotation" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.8.4" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/optional/content.json +introduced_in: draft7 +index: 99 +related: + - vocabulary: validation + keyword: contentEncoding +--- diff --git a/content/draft7/validation/default.markdown b/content/draft7/validation/default.markdown new file mode 100644 index 0000000..c078f35 --- /dev/null +++ b/content/draft7/validation/default.markdown @@ -0,0 +1,25 @@ +--- +keyword: "default" +signature: "Any" +value: This keyword must be set to a JSON value, preferrably that successfully validates against the corresponding subschema +summary: "This keyword can be used to supply a default JSON value associated with a particular schema." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.2" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/default.json +introduced_in: draft1 +index: 9996 +related: + - vocabulary: validation + keyword: title + - vocabulary: validation + keyword: description + - vocabulary: validation + keyword: examples + - vocabulary: validation + keyword: readOnly + - vocabulary: validation + keyword: writeOnly +--- diff --git a/content/draft7/validation/definitions.markdown b/content/draft7/validation/definitions.markdown new file mode 100644 index 0000000..5d65efd --- /dev/null +++ b/content/draft7/validation/definitions.markdown @@ -0,0 +1,19 @@ +--- +keyword: "definitions" +signature: "Object" +value: This keyword must be set to an object where each value is a valid JSON Schema +summary: "This keyword reserves a location for schema authors to inline re-usable JSON Schemas into a more general schema." +kind: [ "location" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.9" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +index: 999 +tests: + - draft7/definitions.json +introduced_in: draft4 +related: + - vocabulary: core + keyword: $ref +--- diff --git a/content/draft7/validation/dependencies.markdown b/content/draft7/validation/dependencies.markdown new file mode 100644 index 0000000..bd1d8cc --- /dev/null +++ b/content/draft7/validation/dependencies.markdown @@ -0,0 +1,25 @@ +--- +keyword: "dependencies" +signature: "Object | Schema>" +value: This keyword must be set to an object where each value is either an array of unique strings or a valid JSON Schema +summary: "Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, either every item in the corresponding array is also the name of a property in the instance or the corresponding subschema successfully evaluates against the instance." +kind: [ "assertion" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.7" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +index: -3 +tests: + - draft7/dependencies.json +introduced_in: 2019-09 +related: + - vocabulary: validation + keyword: required + - vocabulary: validation + keyword: if + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else +--- diff --git a/content/draft7/validation/description.markdown b/content/draft7/validation/description.markdown new file mode 100644 index 0000000..f4af9fc --- /dev/null +++ b/content/draft7/validation/description.markdown @@ -0,0 +1,23 @@ +--- +keyword: "description" +signature: "String" +value: This keyword must be set to a string +summary: "An explanation about the purpose of the instance described by the schema." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.1" +metaschema: "http://json-schema.org/draft-07/schema#" +introduced_in: draft1 +index: 9995 +related: + - vocabulary: validation + keyword: title + - vocabulary: validation + keyword: examples + - vocabulary: validation + keyword: default + - vocabulary: validation + keyword: readOnly + - vocabulary: validation + keyword: writeOnly +--- diff --git a/content/draft7/validation/else.markdown b/content/draft7/validation/else.markdown new file mode 100644 index 0000000..8b22b33 --- /dev/null +++ b/content/draft7/validation/else.markdown @@ -0,0 +1,30 @@ +--- +keyword: "else" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "When [`if`](/draft7/validation/if) is present, and the instance fails to validate against its subschema, then validation succeeds against this keyword if the instance successfully validates against this keyword's subschema." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.6.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +index: 1 +tests: + - draft7/if-then-else.json +introduced_in: draft7 +interdependencies: + - vocabulary: validation + keyword: if +related: + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/enum.markdown b/content/draft7/validation/enum.markdown new file mode 100644 index 0000000..d493ccb --- /dev/null +++ b/content/draft7/validation/enum.markdown @@ -0,0 +1,23 @@ +--- +keyword: "enum" +signature: "Array" +value: This keyword must be set to a *non-empty* array of unique JSON values +summary: "Validation succeeds if the instance is equal to one of the elements in this keyword's array value." +kind: [ "assertion" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.1.2" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/enum.json +introduced_in: draft1 +index: -99998 +related: + - vocabulary: validation + keyword: const + - vocabulary: validation + keyword: type + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf +--- diff --git a/content/draft7/validation/examples.markdown b/content/draft7/validation/examples.markdown new file mode 100644 index 0000000..e9f3b43 --- /dev/null +++ b/content/draft7/validation/examples.markdown @@ -0,0 +1,25 @@ +--- +keyword: "examples" +signature: "Array" +value: This keyword must be set to an array of JSON values that preferrably successfully validates against the corresponding subschema +summary: "This keyword is used to provide sample JSON values associated with a particular schema, for the purpose of illustrating usage." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.4" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "[]" +introduced_in: draft6 +index: 9999 +related: + - vocabulary: validation + keyword: title + - vocabulary: validation + keyword: description + - vocabulary: validation + keyword: default + - vocabulary: validation + keyword: readOnly + - vocabulary: validation + keyword: writeOnly +--- diff --git a/content/draft7/validation/exclusiveMaximum.markdown b/content/draft7/validation/exclusiveMaximum.markdown new file mode 100644 index 0000000..9e35a8b --- /dev/null +++ b/content/draft7/validation/exclusiveMaximum.markdown @@ -0,0 +1,25 @@ +--- +keyword: "exclusiveMaximum" +signature: "Number" +value: This keyword must be set to a number +summary: "Validation succeeds if the numeric instance is less than the given number." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.2.3" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/exclusiveMaximum.json +introduced_in: draft3 +changed_in: + - draft6 +index: -9997 +related: + - vocabulary: validation + keyword: exclusiveMinimum + - vocabulary: validation + keyword: maximum + - vocabulary: validation + keyword: minimum + - vocabulary: validation + keyword: multipleOf +--- diff --git a/content/draft7/validation/exclusiveMinimum.markdown b/content/draft7/validation/exclusiveMinimum.markdown new file mode 100644 index 0000000..5a3b4a1 --- /dev/null +++ b/content/draft7/validation/exclusiveMinimum.markdown @@ -0,0 +1,25 @@ +--- +keyword: "exclusiveMinimum" +signature: "Number" +value: This keyword must be set to a number +summary: "Validation succeeds if the numeric instance is greater than the given number." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.2.5" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/exclusiveMinimum.json +introduced_in: draft3 +changed_in: + - draft6 +index: -9995 +related: + - vocabulary: validation + keyword: exclusiveMaximum + - vocabulary: validation + keyword: maximum + - vocabulary: validation + keyword: minimum + - vocabulary: validation + keyword: multipleOf +--- diff --git a/content/draft7/validation/format.markdown b/content/draft7/validation/format.markdown new file mode 100644 index 0000000..6a2f562 --- /dev/null +++ b/content/draft7/validation/format.markdown @@ -0,0 +1,18 @@ +--- +keyword: "format" +signature: "String" +value: This keyword must be set to a string, preferrably one that is standardized by JSON Schema to ensure interoperability +summary: "Define semantic information about a string instance." +kind: [ "annotation" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.7" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/format.json +introduced_in: draft1 +index: 97 +changed_in: + - draft3 + - draft4 + - draft6 +--- diff --git a/content/draft7/validation/if.markdown b/content/draft7/validation/if.markdown new file mode 100644 index 0000000..03afb9b --- /dev/null +++ b/content/draft7/validation/if.markdown @@ -0,0 +1,28 @@ +--- +keyword: "if" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "This keyword declares a condition based on the validation result of the given schema." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.6.1" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/if-then-else.json +introduced_in: draft7 +index: -1 +affects: + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else +related: + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/items.markdown b/content/draft7/validation/items.markdown new file mode 100644 index 0000000..7fc55a4 --- /dev/null +++ b/content/draft7/validation/items.markdown @@ -0,0 +1,33 @@ +--- +keyword: "items" +signature: "Schema | Array" +value: This keyword must be set to a valid JSON Schema or to a *non-empty* array, where each item is a valid JSON Schema +summary: "If set to a schema, validation succeeds if each element of the instance validates against it, otherwise validation succeeds if each element of the instance validates against the schema at the same position, if any" +kind: [ "applicator" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.1" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +tests: + - draft7/items.json +introduced_in: draft1 +index: -99 +changed_in: + - draft6 +interdependencies: + - vocabulary: validation + keyword: minItems + - vocabulary: validation + keyword: maxItems +affects: + - vocabulary: validation + keyword: additionalItems +related: + - vocabulary: validation + keyword: additionalItems + - vocabulary: validation + keyword: contains + - vocabulary: validation + keyword: uniqueItems +--- diff --git a/content/draft7/validation/maxItems.markdown b/content/draft7/validation/maxItems.markdown new file mode 100644 index 0000000..6c80061 --- /dev/null +++ b/content/draft7/validation/maxItems.markdown @@ -0,0 +1,23 @@ +--- +keyword: "maxItems" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "An array instance is valid if its size is less than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.3" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/maxItems.json +introduced_in: draft1 +index: -97 +related: + - vocabulary: validation + keyword: items + - vocabulary: validation + keyword: additionalItems + - vocabulary: validation + keyword: minItems + - vocabulary: validation + keyword: contains +--- diff --git a/content/draft7/validation/maxLength.markdown b/content/draft7/validation/maxLength.markdown new file mode 100644 index 0000000..703402c --- /dev/null +++ b/content/draft7/validation/maxLength.markdown @@ -0,0 +1,21 @@ +--- +keyword: "maxLength" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.3.1" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/maxLength.json +introduced_in: draft1 +index: -999 +related: + - vocabulary: validation + keyword: minLength + - vocabulary: validation + keyword: pattern + - vocabulary: validation + keyword: format +--- diff --git a/content/draft7/validation/maxProperties.markdown b/content/draft7/validation/maxProperties.markdown new file mode 100644 index 0000000..12d258f --- /dev/null +++ b/content/draft7/validation/maxProperties.markdown @@ -0,0 +1,23 @@ +--- +keyword: "maxProperties" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "An object instance is valid if its number of properties is less than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.1" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/maxProperties.json +introduced_in: draft4 +index: -9 +related: + - vocabulary: validation + keyword: minProperties + - vocabulary: validation + keyword: properties + - vocabulary: validation + keyword: patternProperties + - vocabulary: validation + keyword: additionalProperties +--- diff --git a/content/draft7/validation/maximum.markdown b/content/draft7/validation/maximum.markdown new file mode 100644 index 0000000..6be2ef7 --- /dev/null +++ b/content/draft7/validation/maximum.markdown @@ -0,0 +1,23 @@ +--- +keyword: "maximum" +signature: "Number" +value: This keyword must be set to a number +summary: "Validation succeeds if the numeric instance is less than or equal to the given number." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.2.2" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/maximum.json +introduced_in: draft1 +index: -9998 +related: + - vocabulary: validation + keyword: minimum + - vocabulary: validation + keyword: exclusiveMaximum + - vocabulary: validation + keyword: exclusiveMinimum + - vocabulary: validation + keyword: multipleOf +--- diff --git a/content/draft7/validation/minItems.markdown b/content/draft7/validation/minItems.markdown new file mode 100644 index 0000000..d6a52e3 --- /dev/null +++ b/content/draft7/validation/minItems.markdown @@ -0,0 +1,25 @@ +--- +keyword: "minItems" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "An array instance is valid if its size is greater than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.4" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: 0 +tests: + - draft7/minItems.json +introduced_in: draft1 +index: -96 +related: + - vocabulary: validation + keyword: items + - vocabulary: validation + keyword: additionalItems + - vocabulary: validation + keyword: maxItems + - vocabulary: validation + keyword: contains +--- diff --git a/content/draft7/validation/minLength.markdown b/content/draft7/validation/minLength.markdown new file mode 100644 index 0000000..fa23f47 --- /dev/null +++ b/content/draft7/validation/minLength.markdown @@ -0,0 +1,23 @@ +--- +keyword: "minLength" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.3.2" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: 0 +tests: + - draft7/minLength.json +introduced_in: draft1 +index: -998 +related: + - vocabulary: validation + keyword: maxLength + - vocabulary: validation + keyword: pattern + - vocabulary: validation + keyword: format +--- diff --git a/content/draft7/validation/minProperties.markdown b/content/draft7/validation/minProperties.markdown new file mode 100644 index 0000000..daf98cb --- /dev/null +++ b/content/draft7/validation/minProperties.markdown @@ -0,0 +1,25 @@ +--- +keyword: "minProperties" +signature: "Integer" +value: This keyword must be set to a zero or positive integer +summary: "An object instance is valid if its number of properties is greater than, or equal to, the value of this keyword." +kind: [ "assertion" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.2" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: 0 +tests: + - draft7/minProperties.json +introduced_in: draft4 +index: -8 +related: + - vocabulary: validation + keyword: maxProperties + - vocabulary: validation + keyword: properties + - vocabulary: validation + keyword: patternProperties + - vocabulary: validation + keyword: additionalProperties +--- diff --git a/content/draft7/validation/minimum.markdown b/content/draft7/validation/minimum.markdown new file mode 100644 index 0000000..6108fda --- /dev/null +++ b/content/draft7/validation/minimum.markdown @@ -0,0 +1,23 @@ +--- +keyword: "minimum" +signature: "Number" +value: This keyword must be set to a number +summary: "Validation succeeds if the numeric instance is greater than or equal to the given number." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.2.4" +metaschema: "http://json-schema.org/draft-07/schema#" +tests: + - draft7/minimum.json +introduced_in: draft1 +index: -9996 +related: + - vocabulary: validation + keyword: maximum + - vocabulary: validation + keyword: exclusiveMaximum + - vocabulary: validation + keyword: exclusiveMinimum + - vocabulary: validation + keyword: multipleOf +--- diff --git a/content/draft7/validation/multipleOf.markdown b/content/draft7/validation/multipleOf.markdown new file mode 100644 index 0000000..32f49e5 --- /dev/null +++ b/content/draft7/validation/multipleOf.markdown @@ -0,0 +1,25 @@ +--- +keyword: "multipleOf" +signature: "Number" +value: This keyword must be set to a number that is greater than zero +summary: "A numeric instance is valid only if division by this keyword's value results in an integer." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.2.1" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: 1 +tests: + - draft7/multipleOf.json +introduced_in: draft4 +index: -9999 +related: + - vocabulary: validation + keyword: exclusiveMaximum + - vocabulary: validation + keyword: exclusiveMinimum + - vocabulary: validation + keyword: maximum + - vocabulary: validation + keyword: minimum +--- diff --git a/content/draft7/validation/not.markdown b/content/draft7/validation/not.markdown new file mode 100644 index 0000000..12f8958 --- /dev/null +++ b/content/draft7/validation/not.markdown @@ -0,0 +1,29 @@ +--- +keyword: "not" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.7.4" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "false" +tests: + - draft7/not.json +index: 9 +introduced_in: draft4 +related: + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: if + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else +--- diff --git a/content/draft7/validation/oneOf.markdown b/content/draft7/validation/oneOf.markdown new file mode 100644 index 0000000..0c2712f --- /dev/null +++ b/content/draft7/validation/oneOf.markdown @@ -0,0 +1,29 @@ +--- +keyword: "oneOf" +signature: "Array" +value: This keyword must be set to a *non-empty* array, where each item is a valid JSON Schema +summary: "An instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword's value." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.7.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + logical_value: "[]" +tests: + - draft7/oneOf.json +index: 8 +introduced_in: draft4 +related: + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: if + - vocabulary: validation + keyword: then + - vocabulary: validation + keyword: else + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/pattern.markdown b/content/draft7/validation/pattern.markdown new file mode 100644 index 0000000..6cc7713 --- /dev/null +++ b/content/draft7/validation/pattern.markdown @@ -0,0 +1,25 @@ +--- +keyword: "pattern" +signature: "String" +value: This keyword must be set to a valid [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) regular expression +summary: "A string instance is considered valid if the regular expression matches the instance successfully." +kind: [ "assertion" ] +instance: [ "string" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.3.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "\".*\"" +tests: + - draft7/pattern.json + - draft7/optional/ecmascript-regex.json + - draft7/optional/non-bmp-regex.json +introduced_in: draft1 +index: -997 +changed_in: + - draft4 +related: + - vocabulary: validation + keyword: format + - vocabulary: validation + keyword: patternProperties +--- diff --git a/content/draft7/validation/patternProperties.markdown b/content/draft7/validation/patternProperties.markdown new file mode 100644 index 0000000..81cafda --- /dev/null +++ b/content/draft7/validation/patternProperties.markdown @@ -0,0 +1,34 @@ +--- +keyword: "patternProperties" +signature: "Object" +value: This keyword must be set to an object where each key is a valid [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) regular expression and each value is a valid JSON Schema +summary: "Validation succeeds if, for each instance name that matches any regular expressions that appear as a property name in this keyword's value, the child instance for that name successfully validates against each schema that corresponds to a matching regular expression." +kind: [ "applicator" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.5" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +tests: + - draft7/patternProperties.json +introduced_in: draft3 +index: -5 +changed_in: + - draft4 +affects: + - vocabulary: validation + keyword: additionalProperties +related: + - vocabulary: validation + keyword: properties + - vocabulary: validation + keyword: dependencies + - vocabulary: validation + keyword: propertyNames + - vocabulary: validation + keyword: required + - vocabulary: validation + keyword: minProperties + - vocabulary: validation + keyword: maxProperties +--- diff --git a/content/draft7/validation/properties.markdown b/content/draft7/validation/properties.markdown new file mode 100644 index 0000000..bcdb31c --- /dev/null +++ b/content/draft7/validation/properties.markdown @@ -0,0 +1,32 @@ +--- +keyword: "properties" +signature: "Object" +value: This keyword must be set to an object where each value is a valid JSON Schema +summary: "Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, the child instance for that name successfully validates against the corresponding schema." +kind: [ "applicator" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.4" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +tests: + - draft7/properties.json +introduced_in: draft1 +index: -6 +affects: + - vocabulary: validation + keyword: additionalProperties +related: + - vocabulary: validation + keyword: patternProperties + - vocabulary: validation + keyword: dependencies + - vocabulary: validation + keyword: propertyNames + - vocabulary: validation + keyword: required + - vocabulary: validation + keyword: minProperties + - vocabulary: validation + keyword: maxProperties +--- diff --git a/content/draft7/validation/propertyNames.markdown b/content/draft7/validation/propertyNames.markdown new file mode 100644 index 0000000..60fa45a --- /dev/null +++ b/content/draft7/validation/propertyNames.markdown @@ -0,0 +1,29 @@ +--- +keyword: "propertyNames" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "Validation succeeds if the schema validates against every property name in the instance." +kind: [ "applicator" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.8" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +index: -2 +tests: + - draft7/propertyNames.json +introduced_in: draft6 +related: + - vocabulary: validation + keyword: patternProperties + - vocabulary: validation + keyword: additionalProperties + - vocabulary: validation + keyword: dependencies + - vocabulary: validation + keyword: required + - vocabulary: validation + keyword: minProperties + - vocabulary: validation + keyword: maxProperties +--- diff --git a/content/draft7/validation/readOnly.markdown b/content/draft7/validation/readOnly.markdown new file mode 100644 index 0000000..a1460ac --- /dev/null +++ b/content/draft7/validation/readOnly.markdown @@ -0,0 +1,25 @@ +--- +keyword: "readOnly" +signature: "Boolean" +value: This keyword must be set to a boolean value +summary: "This keyword indicates that the value of the instance is managed exclusively by the owning authority, and attempts by an application to modify the value of this property are expected to be ignored or rejected by that owning authority." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: false +introduced_in: draft7 +index: 9997 +related: + - vocabulary: validation + keyword: writeOnly + - vocabulary: validation + keyword: title + - vocabulary: validation + keyword: description + - vocabulary: validation + keyword: examples + - vocabulary: validation + keyword: default +--- diff --git a/content/draft7/validation/required.markdown b/content/draft7/validation/required.markdown new file mode 100644 index 0000000..726a3ec --- /dev/null +++ b/content/draft7/validation/required.markdown @@ -0,0 +1,25 @@ +--- +keyword: "required" +signature: "Array" +value: This keyword must be set to an array of unique strings +summary: "An object instance is valid against this keyword if every item in the array is the name of a property in the instance." +kind: [ "assertion" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.5.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "[]" +tests: + - draft7/required.json +introduced_in: draft3 +index: -7 +changed_in: + - draft4 +related: + - vocabulary: validation + keyword: dependencies + - vocabulary: validation + keyword: maxProperties + - vocabulary: validation + keyword: minProperties +--- diff --git a/content/draft7/validation/then.markdown b/content/draft7/validation/then.markdown new file mode 100644 index 0000000..5379a7b --- /dev/null +++ b/content/draft7/validation/then.markdown @@ -0,0 +1,29 @@ +--- +keyword: "then" +signature: "Schema" +value: This keyword must be set to a valid JSON Schema +summary: "When [`if`](/draft7/validation/if) is present, and the instance successfully validates against its subschema, then validation succeeds against this keyword if the instance also successfully validates against this keyword's subschema." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.6.2" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "{}" +tests: + - draft7/if-then-else.json +introduced_in: draft7 +interdependencies: + - vocabulary: validation + keyword: if +related: + - vocabulary: validation + keyword: else + - vocabulary: validation + keyword: allOf + - vocabulary: validation + keyword: anyOf + - vocabulary: validation + keyword: oneOf + - vocabulary: validation + keyword: not +--- diff --git a/content/draft7/validation/title.markdown b/content/draft7/validation/title.markdown new file mode 100644 index 0000000..621432d --- /dev/null +++ b/content/draft7/validation/title.markdown @@ -0,0 +1,23 @@ +--- +keyword: "title" +signature: "String" +value: This keyword must be set to a string +summary: "A preferably short description about the purpose of the instance described by the schema." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.1" +metaschema: "http://json-schema.org/draft-07/schema#" +introduced_in: draft1 +index: 9994 +related: + - vocabulary: validation + keyword: description + - vocabulary: validation + keyword: examples + - vocabulary: validation + keyword: default + - vocabulary: validation + keyword: readOnly + - vocabulary: validation + keyword: writeOnly +--- diff --git a/content/draft7/validation/type.markdown b/content/draft7/validation/type.markdown new file mode 100644 index 0000000..b485041 --- /dev/null +++ b/content/draft7/validation/type.markdown @@ -0,0 +1,18 @@ +--- +keyword: "type" +signature: "String | Array" +value: This keyword must be set to either a string that corresponds to one of the supported types, or a *non-empty* array of unique strings that correspond to one of the supported types +summary: "Validation succeeds if the type of the instance matches the type represented by the given type, or matches at least one of the given types." +kind: [ "assertion" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.1.1" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: "[ \"null\", \"boolean\", \"object\", \"array\", \"number\", \"string\" ]" +tests: + - draft7/type.json +index: -99999 +introduced_in: draft1 +changed_in: + - draft4 +--- diff --git a/content/draft7/validation/uniqueItems.markdown b/content/draft7/validation/uniqueItems.markdown new file mode 100644 index 0000000..0cea389 --- /dev/null +++ b/content/draft7/validation/uniqueItems.markdown @@ -0,0 +1,23 @@ +--- +keyword: "uniqueItems" +signature: "Boolean" +value: This keyword must be set to a boolean value +summary: "If this keyword is set to the boolean value true, the instance validates successfully if all of its elements are unique." +kind: [ "assertion" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.6.4.5" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: false +tests: + - draft7/uniqueItems.json +introduced_in: draft2 +index: -95 +related: + - vocabulary: validation + keyword: items + - vocabulary: validation + keyword: additionalItems + - vocabulary: validation + keyword: contains +--- diff --git a/content/draft7/validation/writeOnly.markdown b/content/draft7/validation/writeOnly.markdown new file mode 100644 index 0000000..b448989 --- /dev/null +++ b/content/draft7/validation/writeOnly.markdown @@ -0,0 +1,25 @@ +--- +keyword: "writeOnly" +signature: "Boolean" +value: This keyword must be set to a boolean value +summary: "This keyword indicates that the value is never present when the instance is retrieved from the owning authority." +kind: [ "annotation" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.3" +metaschema: "http://json-schema.org/draft-07/schema#" +default: + value: false +introduced_in: draft7 +index: 9998 +related: + - vocabulary: validation + keyword: readOnly + - vocabulary: validation + keyword: title + - vocabulary: validation + keyword: description + - vocabulary: validation + keyword: examples + - vocabulary: validation + keyword: default +--- diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 8c3959b..058dee2 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -1,5 +1,5 @@ -{{ define "title" }}{{ if eq .Page.Section .Title }}JSON Schema {{ .Title }}{{ else }}{{ .Title }} vocabulary ({{ .Page.Section }}){{ end }}{{ end }} -{{ define "description" }}Reference documentation for {{ if eq .Page.Section .Title }}JSON Schema {{ .Title }}{{ else }}the {{ .Title }} JSON Schema {{ .Page.Section }} vocabulary{{ end }}. {{ .Summary }}{{ end }} +{{ define "title" }}{{ if (eq .Page.Section (replace (lower .Title) " " "")) }}JSON Schema {{ .Title }}{{ else }}{{ .Title }} vocabulary ({{ .Page.Section }}){{ end }}{{ end }} +{{ define "description" }}Reference documentation for {{ if (eq .Page.Section (replace (lower .Title) " " "")) }}JSON Schema {{ .Title }}{{ else }}the {{ .Title }} JSON Schema {{ .Page.Section }} vocabulary{{ end }}. {{ .Summary }}{{ end }} {{ define "main" }} {{ $dialect := .Page.Section }} @@ -7,15 +7,17 @@ {{ $githubURL := .File.Path | printf "%s/blob/main/content/%s" .Site.Params.GitHub }} {{ $siteSections := .Site.Sections }} -{{ if eq .Page.Section .Title }} +{{ $isDialect := (eq .Page.Section (replace (lower .Title) " " "")) }} + +{{ if $isDialect }} {{ partial "breadcrumb.html" (dict - "dialect" $dialect + "dialect" (.Title) "githubURL" $githubURL "siteSections" $siteSections ) }} {{ else }} {{ $vocabulary := .Title }} {{ partial "breadcrumb.html" (dict - "dialect" $dialect + "dialect" ($.Site.GetPage (printf "/%s" .Page.Section)).Title "dialectURL" (ref . $dialectURL) "vocabulary" $vocabulary "githubURL" $githubURL @@ -28,7 +30,7 @@

{{ .Title }} - {{ if eq .Page.Section .Title }} + {{ if $isDialect }} Dialect {{ else }} @@ -43,7 +45,7 @@

{{ .Title }}
- {{ if ne .Page.Section .Title }} + {{ if not $isDialect }} {{ end }} - {{ if ne .Page.Section .Title }} + {{ if not $isDialect }} {{ if isset .Params "related" }} @@ -151,7 +153,7 @@

{{ .Title }} {{ .Content }} - {{ if eq .Page.Section .Title }} + {{ if $isDialect }}

Using this dialect

{{ $coreVocabularyURL := "core" | printf "%s/%s" $dialectURL }} {{ $schemaKeywordURL := "schema" | printf "%s/%s" $coreVocabularyURL }} @@ -199,26 +201,30 @@

{{ .Title }} {{ partial "vocabulary-badges.html" .Params }}

{{ if .Params.mandatory }}

This vocabulary is mandatory on this dialect. It is available by default and cannot be removed.

{{ else }} - {{ if .Params.default }} - - {{ end }} + {{ if in (slice "/draft4" "/draft6" "/draft7") $dialectURL }} + {{ else }} + {{ if .Params.default }} + + {{ end }} + + {{ $coreVocabularyURL := "core" | printf "%s/%s" $dialectURL }} + {{ $vocabularyKeywordURL := "vocabulary" | printf "%s/%s" $coreVocabularyURL }} +

To make use of this vocabulary, modify your metaschema to declare the use of this vocabulary using the $vocabulary keyword and evaluate its metaschema. If the vocabulary must be present for an implementation to proceed:

- {{ $coreVocabularyURL := "core" | printf "%s/%s" $dialectURL }} - {{ $vocabularyKeywordURL := "vocabulary" | printf "%s/%s" $coreVocabularyURL }} -

To make use of this vocabulary, modify your metaschema to declare the use of this vocabulary using the $vocabulary keyword and evaluate its metaschema. If the vocabulary must be present for an implementation to proceed:

+ {{ $usingVocabularyRequired := .Params.metaschema | printf "{\n ...\n \"$vocabulary\": {\n ...\n \"%s\": true\n },\n \"allOf\": [\n { \"$ref\": \"%s\" }\n ]\n}" .Params.uri }} + {{ transform.Highlight $usingVocabularyRequired "json" }} - {{ $usingVocabularyRequired := .Params.metaschema | printf "{\n ...\n \"$vocabulary\": {\n ...\n \"%s\": true\n },\n \"allOf\": [\n { \"$ref\": \"%s\" }\n ]\n}" .Params.uri }} - {{ transform.Highlight $usingVocabularyRequired "json" }} +

Otherwise, if it is optional for implementations to understand this vocabulary to proceed:

-

Otherwise, if it is optional for implementations to understand this vocabulary to proceed:

+ {{ $usingVocabularyOptional := .Params.metaschema | printf "{\n ...\n \"$vocabulary\": {\n ...\n \"%s\": false\n },\n \"allOf\": [\n { \"$ref\": \"%s\" }\n ]\n}" .Params.uri }} + {{ transform.Highlight $usingVocabularyOptional "json" }} - {{ $usingVocabularyOptional := .Params.metaschema | printf "{\n ...\n \"$vocabulary\": {\n ...\n \"%s\": false\n },\n \"allOf\": [\n { \"$ref\": \"%s\" }\n ]\n}" .Params.uri }} - {{ transform.Highlight $usingVocabularyOptional "json" }} + {{ end }} {{ end }}

Keywords

diff --git a/layouts/partials/dialect-badge.html b/layouts/partials/dialect-badge.html index 1234017..ddeac22 100644 --- a/layouts/partials/dialect-badge.html +++ b/layouts/partials/dialect-badge.html @@ -7,8 +7,9 @@ {{ .name }} {{ else if eq (.name) "draft7" }} - Draft 7 + + Draft 7 + {{ else if eq (.name) "draft6" }} Draft 6 diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 77f6ab2..0fabefe 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -14,7 +14,7 @@ {{ $selected_dialect := index (split .RelPermalink "/") 1 }} {{ range .Site.Sections }} - {{ $dialect := .Title }} + {{ $dialect := (replace (lower .Title) " " "") }} {{ if eq $selected_dialect $dialect }} {{ $dialectURL := $dialect | printf "/%s" }}
{{ partial "term.html" (dict @@ -129,7 +131,7 @@

{{ .Title }}

Also see