Skip to content

Commit

Permalink
Outline JSON Schema Draft 7
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Nov 5, 2024
1 parent b863c4a commit 7e20547
Show file tree
Hide file tree
Showing 58 changed files with 1,229 additions and 36 deletions.
2 changes: 0 additions & 2 deletions content/2019-09/applicator/propertyNames.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ tests:
index: -997
introduced_in: draft6
related:
- vocabulary: applicator
keyword: propertyNames
- vocabulary: applicator
keyword: patternProperties
- vocabulary: applicator
Expand Down
2 changes: 1 addition & 1 deletion content/2019-09/core/defs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
keyword: "$defs"
signature: "Object<String, Schema>"
value: This keyword must be set to an object where each value is a valid JSON Schema
summary: "This keyword is used in meta-schemas to identify the required and optional vocabularies available for use in schemas described by that meta-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/2019-09/draft-handrews-json-schema-02#rfc.section.8.2.5"
Expand Down
2 changes: 1 addition & 1 deletion content/2019-09/validation/multipleOf.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keyword: "multipleOf"
signature: "Number"
value: This keyword must be set to a number that is not equal to zero
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" ]
Expand Down
2 changes: 0 additions & 2 deletions content/2020-12/applicator/propertyNames.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ tests:
index: -997
introduced_in: draft6
related:
- vocabulary: applicator
keyword: propertyNames
- vocabulary: applicator
keyword: patternProperties
- vocabulary: applicator
Expand Down
2 changes: 1 addition & 1 deletion content/2020-12/core/defs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
keyword: "$defs"
signature: "Object<String, Schema>"
value: This keyword must be set to an object where each value is a valid JSON Schema
summary: "This keyword is used in meta-schemas to identify the required and optional vocabularies available for use in schemas described by that meta-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/2020-12/json-schema-core.html#section-8.2.4"
Expand Down
2 changes: 1 addition & 1 deletion content/2020-12/validation/multipleOf.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keyword: "multipleOf"
signature: "Number"
value: This keyword must be set to a number that is not equal to zero
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" ]
Expand Down
21 changes: 21 additions & 0 deletions content/draft7/_index.markdown
Original file line number Diff line number Diff line change
@@ -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"
---
18 changes: 18 additions & 0 deletions content/draft7/core/_index.markdown
Original file line number Diff line number Diff line change
@@ -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
---
12 changes: 12 additions & 0 deletions content/draft7/core/comment.markdown
Original file line number Diff line number Diff line change
@@ -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
---
20 changes: 20 additions & 0 deletions content/draft7/core/id.markdown
Original file line number Diff line number Diff line change
@@ -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
---
26 changes: 26 additions & 0 deletions content/draft7/core/ref.markdown
Original file line number Diff line number Diff line change
@@ -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
---
19 changes: 19 additions & 0 deletions content/draft7/core/schema.markdown
Original file line number Diff line number Diff line change
@@ -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
---
20 changes: 20 additions & 0 deletions content/draft7/validation/_index.markdown
Original file line number Diff line number Diff line change
@@ -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
---
28 changes: 28 additions & 0 deletions content/draft7/validation/additionalItems.markdown
Original file line number Diff line number Diff line change
@@ -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
---
32 changes: 32 additions & 0 deletions content/draft7/validation/additionalProperties.markdown
Original file line number Diff line number Diff line change
@@ -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
---
29 changes: 29 additions & 0 deletions content/draft7/validation/allOf.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
keyword: "allOf"
signature: "Array<Schema>"
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
---
29 changes: 29 additions & 0 deletions content/draft7/validation/anyOf.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
keyword: "anyOf"
signature: "Array<Schema>"
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
---
19 changes: 19 additions & 0 deletions content/draft7/validation/const.markdown
Original file line number Diff line number Diff line change
@@ -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
---
27 changes: 27 additions & 0 deletions content/draft7/validation/contains.markdown
Original file line number Diff line number Diff line change
@@ -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
---
17 changes: 17 additions & 0 deletions content/draft7/validation/contentEncoding.markdown
Original file line number Diff line number Diff line change
@@ -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
---
Loading

0 comments on commit 7e20547

Please sign in to comment.