diff --git a/content/draft3/core/_index.markdown b/content/draft3/core/_index.markdown new file mode 100644 index 0000000..a576210 --- /dev/null +++ b/content/draft3/core/_index.markdown @@ -0,0 +1,18 @@ +--- +title: "Draft 3" +description: "A JSON Media Type for Describing the Structure and Meaning of JSON Documents" +summary: "JSON Schema Draft 3 is a JSON media type that provides a contract for what JSON data is required for a given application and how to interact with it. 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-03/draft-zyp-json-schema-03" +index: -99 +authors: + - github: kriszyp + first: Kris + last: Zyp + - github: garycourt + first: Gary + last: Court +metaschema: "http://json-schema.org/draft-03/schema#" +year: 2010 +bowtie: "https://bowtie.report/#/dialects/draft3" +--- diff --git a/content/draft3/core/additionalItems.markdown b/content/draft3/core/additionalItems.markdown new file mode 100644 index 0000000..1c1504f --- /dev/null +++ b/content/draft3/core/additionalItems.markdown @@ -0,0 +1,26 @@ +--- +keyword: "additionalItems" +signature: "Schema | Boolean" +value: This keyword must be set to a valid JSON Schema +summary: "If [`items`](/draft3/validation/items) is set to an array of schemas, validation succeeds if each element of the instance not covered by it validates against this schema. If set to a boolean, no additional items are allowed in the array instance." +kind: [ "applicator" ] +instance: [ "array" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.6" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "{}" +tests: + - draft3/additionalItems.json +index: -98 +introduced_in: draft3 +interdependencies: + - vocabulary: core + keyword: items + - vocabulary: core + keyword: minItems + - vocabulary: core + keyword: maxItems +related: + - vocabulary: core + keyword: uniqueItems +--- diff --git a/content/draft3/core/additionalProperties.markdown b/content/draft3/core/additionalProperties.markdown new file mode 100644 index 0000000..e9fe2fb --- /dev/null +++ b/content/draft3/core/additionalProperties.markdown @@ -0,0 +1,30 @@ +--- +keyword: "additionalProperties" +signature: "Schema | Boolean" +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. If set to a boolean, no additional properties are allowed in the instance." +kind: [ "applicator" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.4" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/additionalProperties.json +default: + value: "{}" +introduced_in: draft1 +index: -4 +interdependencies: + - vocabulary: core + keyword: properties + - vocabulary: core + keyword: patternProperties +related: + - vocabulary: core + keyword: dependencies + - vocabulary: core + keyword: required + - vocabulary: core + keyword: minProperties + - vocabulary: core + keyword: maxProperties +--- diff --git a/content/draft3/core/default.markdown b/content/draft3/core/default.markdown new file mode 100644 index 0000000..bbd277c --- /dev/null +++ b/content/draft3/core/default.markdown @@ -0,0 +1,19 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.20" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/default.json +introduced_in: draft1 +index: 9996 +related: + - vocabulary: core + keyword: title + - vocabulary: core + keyword: description +--- diff --git a/content/draft3/core/dependencies.markdown b/content/draft3/core/dependencies.markdown new file mode 100644 index 0000000..eaab974 --- /dev/null +++ b/content/draft3/core/dependencies.markdown @@ -0,0 +1,19 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.8" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "{}" +index: -3 +tests: + - draft3/dependencies.json +introduced_in: draft3 +related: + - vocabulary: core + keyword: required +--- diff --git a/content/draft3/core/description.markdown b/content/draft3/core/description.markdown new file mode 100644 index 0000000..29f855e --- /dev/null +++ b/content/draft3/core/description.markdown @@ -0,0 +1,17 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.22" +metaschema: "http://json-schema.org/draft-03/schema#" +introduced_in: draft1 +index: 9995 +related: + - vocabulary: core + keyword: title + - vocabulary: core + keyword: default +--- diff --git a/content/draft3/core/disallow.markdown b/content/draft3/core/disallow.markdown new file mode 100644 index 0000000..a764e75 --- /dev/null +++ b/content/draft3/core/disallow.markdown @@ -0,0 +1,17 @@ +--- +keyword: "disallow" +signature: "String | Array | Any" +value: This keyword is opposite of the `type` keyword. If the instance is set to either a string that corresponds to one of the supported types, or any instance matching the values in a *non-empty* array of unique strings that correspond to one of the supported types, the instance is invalid +summary: "Validation succeeds if the type of the instance does not match the type represented by the given type, or does not match at least one of the given types." +kind: [ "assertion" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.25" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "[ \"null\", \"boolean\", \"object\", \"array\", \"number\", \"string\", \"any\"]" +tests: + - draft3/disallow.json +index: -99999 +introduced_in: draft1 +removed_in: draft4 +--- diff --git a/content/draft3/core/divisibleBy.markdown b/content/draft3/core/divisibleBy.markdown new file mode 100644 index 0000000..999f481 --- /dev/null +++ b/content/draft3/core/divisibleBy.markdown @@ -0,0 +1,27 @@ +--- +keyword: "divisibleBy" +signature: "Number" +value: This keyword must be set to a number that is not equal to 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-03/draft-zyp-json-schema-03.pdf#5.24" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: 1 +tests: + - draft3/divisibleBy.json +introduced_in: draft3 +removed_in: draft4 +changed_in: draft4 +index: -9999 +related: + - vocabulary: core + keyword: exclusiveMaximum + - vocabulary: core + keyword: exclusiveMinimum + - vocabulary: core + keyword: maximum + - vocabulary: core + keyword: minimum +--- diff --git a/content/draft3/core/enum.markdown b/content/draft3/core/enum.markdown new file mode 100644 index 0000000..1a0a40b --- /dev/null +++ b/content/draft3/core/enum.markdown @@ -0,0 +1,19 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.19" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/enum.json +introduced_in: draft1 +index: -99998 +related: + - vocabulary: core + keyword: type + - vocabulary: core + keyword: extends +--- diff --git a/content/draft3/core/exclusiveMaximum.markdown b/content/draft3/core/exclusiveMaximum.markdown new file mode 100644 index 0000000..1e423b4 --- /dev/null +++ b/content/draft3/core/exclusiveMaximum.markdown @@ -0,0 +1,52 @@ +--- +keyword: "exclusiveMaximum" +signature: "Boolean" +value: This keyword must be set to a boolean value +summary: "When [`maximum`](/draft3/validation/maximum) is present and this keyword is set to true, the numeric instance must be less than the value in [`maximum`](/draft3/validation/maximum)." +summary: "Validation succeeds if the numeric instance is less than the given number." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.12" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "false" +tests: + - draft3/maximum.json + - draft3/optional/bignum.json +introduced_in: draft3 +changed_in: + - draft6 +index: -9997 +affects: + - vocabulary: core + keyword: maximum +related: + - vocabulary: core + keyword: exclusiveMinimum + - vocabulary: core + keyword: maximum + - vocabulary: core + keyword: minimum + - vocabulary: core + keyword: divisibleBy +--- + +## Examples + +{{}} +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "number", + "maximum": 3.0, + "exclusiveMaximum: true +} +{{}} + +{{}} +2.2 +{{}} + + +{{}} +3.0 +{{}} diff --git a/content/draft3/core/exclusiveMinimum.markdown b/content/draft3/core/exclusiveMinimum.markdown new file mode 100644 index 0000000..fd81c99 --- /dev/null +++ b/content/draft3/core/exclusiveMinimum.markdown @@ -0,0 +1,50 @@ +--- +keyword: "exclusiveMinimum" +signature: "Boolean" +value: This keyword must be set to a boolean value +summary: "When [`minimum`](/draft3/validation/minimum) is present and this keyword is set to true, the numeric instance must be greater than the value in [`minimum`](/draft3/validation/minimum)." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.11" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "false" +tests: + - draft3/minimum.json + - draft3/optional/bignum.json +introduced_in: draft3 +changed_in: + - draft6 +index: -9995 +affects: + - vocabulary: core + keyword: minimum +related: + - vocabulary: core + keyword: exclusiveMaximum + - vocabulary: core + keyword: maximum + - vocabulary: core + keyword: minimum + - vocabulary: core + keyword: divisibleBy +--- + +## Examples + +{{}} +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "number", + "minimum": 1.1, + "exclusiveMinimum: true +} +{{}} + +{{}} +1.2 +{{}} + +{{}} +1.1 +{{}} diff --git a/content/draft3/core/extends.markdown b/content/draft3/core/extends.markdown new file mode 100644 index 0000000..173fea4 --- /dev/null +++ b/content/draft3/core/extends.markdown @@ -0,0 +1,20 @@ +--- +keyword: "extends" +signature: "URI Reference | Schema | Array" +value: This keyword must be set to either a schema, a list of schemas, or a URI that points to a schema +summary: "Validation succeeds if the instance is valid against the schema or schemas defined by this keyword" +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.26" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + logical_value: "[]" +tests: + - draft3/extends.json +index: 6 +introduced_in: draft1 +removed_in: draft4 +related: + - vocabulary: core + keyword: enum +--- diff --git a/content/draft3/core/format.markdown b/content/draft3/core/format.markdown new file mode 100644 index 0000000..8914d31 --- /dev/null +++ b/content/draft3/core/format.markdown @@ -0,0 +1,17 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.23" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/format.json +introduced_in: draft1 +index: 97 +changed_in: + - draft3 + - draft4 +--- diff --git a/content/draft3/core/id.markdown b/content/draft3/core/id.markdown new file mode 100644 index 0000000..be0992e --- /dev/null +++ b/content/draft3/core/id.markdown @@ -0,0 +1,19 @@ +--- +keyword: "id" +signature: "URI Reference" +value: This keyword may be set to an absolute URI or a relative reference +summary: "This keyword declares an identifier for the schema resource." +kind: [ "identifier" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.27" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: +index: -999 +introduced_in: draft3 +affects: + - vocabulary: core + keyword: $ref +related: + - vocabulary: core + keyword: $schema +--- diff --git a/content/draft3/core/items.markdown b/content/draft3/core/items.markdown new file mode 100644 index 0000000..8e9219c --- /dev/null +++ b/content/draft3/core/items.markdown @@ -0,0 +1,29 @@ +--- +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. If set to an array, 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-03/draft-zyp-json-schema-03.pdf#5.5" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "{}" +tests: + - draft3/items.json +introduced_in: draft1 +index: -99 +interdependencies: + - vocabulary: core + keyword: minItems + - vocabulary: core + keyword: maxItems +affects: + - vocabulary: core + keyword: additionalItems +related: + - vocabulary: core + keyword: additionalItems + - vocabulary: core + keyword: uniqueItems +--- diff --git a/content/draft3/core/maxItems.markdown b/content/draft3/core/maxItems.markdown new file mode 100644 index 0000000..86308eb --- /dev/null +++ b/content/draft3/core/maxItems.markdown @@ -0,0 +1,44 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.14" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/maxItems.json +introduced_in: draft1 +index: -97 +related: + - vocabulary: core + keyword: items + - vocabulary: core + keyword: additionalItems + - vocabulary: core + keyword: minItems +--- + +## Examples + +{{}} +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "array", + "maxItems": 3, + "items": { + "type": "string" + } +} +{{}} + +{{}} +["learn", "json", "schema"] +{{}} + + +{{}} +["learn", "json", "schema", "draft3"] +{{}} + diff --git a/content/draft3/core/maxLength.markdown b/content/draft3/core/maxLength.markdown new file mode 100644 index 0000000..5fac5ad --- /dev/null +++ b/content/draft3/core/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-03/draft-zyp-json-schema-03.pdf#5.18" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/maxLength.json +introduced_in: draft1 +index: -999 +related: + - vocabulary: core + keyword: minLength + - vocabulary: core + keyword: pattern + - vocabulary: core + keyword: format +--- diff --git a/content/draft3/core/maximum.markdown b/content/draft3/core/maximum.markdown new file mode 100644 index 0000000..79a2ffd --- /dev/null +++ b/content/draft3/core/maximum.markdown @@ -0,0 +1,27 @@ +--- +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, depending on the value of [`exclusiveMaximum`](/draft3/validation/exclusiveMaximum), if any." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.10" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/maximum.json + - draft3/optional/bignum.json +introduced_in: draft1 +index: -9998 +interdependencies: + - vocabulary: core + keyword: exclusiveMaximum +related: + - vocabulary: core + keyword: minimum + - vocabulary: core + keyword: exclusiveMaximum + - vocabulary: core + keyword: exclusiveMinimum + - vocabulary: core + keyword: divisibleBy +--- diff --git a/content/draft3/core/minItems.markdown b/content/draft3/core/minItems.markdown new file mode 100644 index 0000000..eb2cb0a --- /dev/null +++ b/content/draft3/core/minItems.markdown @@ -0,0 +1,45 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.13" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: 0 +tests: + - draft3/minItems.json +introduced_in: draft1 +index: -96 +related: + - vocabulary: core + keyword: items + - vocabulary: core + keyword: additionalItems + - vocabulary: core + keyword: maxItems +--- + +## Examples + +{{}} +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } +} +{{}} + +{{}} +["learn"] +{{}} + + +{{}} +[] +{{}} diff --git a/content/draft3/core/minLength.markdown b/content/draft3/core/minLength.markdown new file mode 100644 index 0000000..91af6b5 --- /dev/null +++ b/content/draft3/core/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-03/draft-zyp-json-schema-03.pdf#5.17" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: 0 +tests: + - draft3/minLength.json +introduced_in: draft1 +index: -998 +related: + - vocabulary: core + keyword: maxLength + - vocabulary: core + keyword: pattern + - vocabulary: core + keyword: format +--- diff --git a/content/draft3/core/minimum.markdown b/content/draft3/core/minimum.markdown new file mode 100644 index 0000000..be8aba6 --- /dev/null +++ b/content/draft3/core/minimum.markdown @@ -0,0 +1,27 @@ +--- +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, depending on the value of [`exclusiveMinimum`](/draft3/validation/exclusiveMinimum), if any." +kind: [ "assertion" ] +instance: [ "number" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.9" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/minimum.json + - draft3/optional/bignum.json +introduced_in: draft1 +index: -9996 +interdependencies: + - vocabulary: core + keyword: exclusiveMinimum +related: + - vocabulary: core + keyword: maximum + - vocabulary: core + keyword: exclusiveMaximum + - vocabulary: core + keyword: exclusiveMinimum + - vocabulary: core + keyword: divisibleBy +--- diff --git a/content/draft3/core/pattern.markdown b/content/draft3/core/pattern.markdown new file mode 100644 index 0000000..bf0f373 --- /dev/null +++ b/content/draft3/core/pattern.markdown @@ -0,0 +1,22 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.16" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "\".*\"" +tests: + - draft3/pattern.json + - draft3/optional/non-bmp-regex.json +introduced_in: draft1 +index: -997 +related: + - vocabulary: core + keyword: format + - vocabulary: core + keyword: patternProperties +--- diff --git a/content/draft3/core/patternProperties.markdown b/content/draft3/core/patternProperties.markdown new file mode 100644 index 0000000..63f0cf2 --- /dev/null +++ b/content/draft3/core/patternProperties.markdown @@ -0,0 +1,30 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.3" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "{}" +tests: + - draft3/patternProperties.json +introduced_in: draft3 +index: -5 +affects: + - vocabulary: core + keyword: additionalProperties +related: + - vocabulary: core + keyword: properties + - vocabulary: core + keyword: dependencies + - vocabulary: core + keyword: required + - vocabulary: core + keyword: minProperties + - vocabulary: core + keyword: maxProperties +--- diff --git a/content/draft3/core/properties.markdown b/content/draft3/core/properties.markdown new file mode 100644 index 0000000..ace11c7 --- /dev/null +++ b/content/draft3/core/properties.markdown @@ -0,0 +1,30 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.2" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "{}" +tests: + - draft3/properties.json +introduced_in: draft1 +index: -6 +affects: + - vocabulary: core + keyword: additionalProperties +related: + - vocabulary: core + keyword: patternProperties + - vocabulary: core + keyword: dependencies + - vocabulary: core + keyword: required + - vocabulary: core + keyword: minProperties + - vocabulary: core + keyword: maxProperties +--- diff --git a/content/draft3/core/ref.markdown b/content/draft3/core/ref.markdown new file mode 100644 index 0000000..f434dbf --- /dev/null +++ b/content/draft3/core/ref.markdown @@ -0,0 +1,22 @@ +--- +keyword: "$ref" +signature: "URI Reference" +value: This keyword may be set to an absolute URI or a relative reference +summary: "This keyword is used to reference a statically identified schema." +kind: [ "applicator" ] +instance: [ "any" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.28" +metaschema: "http://json-schema.org/draft-03/schema#" +tests: + - draft3/ref.json + - draft3/refRemote.json + - draft3/infinite-loop-detection.json +index: -99 +introduced_in: draft3 +interdependencies: + - vocabulary: core + keyword: id +related: + - vocabulary: core + keyword: definitions +--- diff --git a/content/draft3/core/required.markdown b/content/draft3/core/required.markdown new file mode 100644 index 0000000..7101864 --- /dev/null +++ b/content/draft3/core/required.markdown @@ -0,0 +1,47 @@ +--- +keyword: "required" +signature: "Boolean" +value: This keyword is defined in the property definition subschema where a value must be defined within an instance +summary: "An object instance is valid if the name of the required property exists in the instance." +kind: [ "assertion" ] +instance: [ "object" ] +specification: "https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.7" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "false" +tests: + - draft3/required.json +introduced_in: draft3 +changed_in: draft4 +index: -7 +related: + - vocabulary: core + keyword: dependencies + - vocabulary: core + keyword: maxProperties + - vocabulary: core + keyword: minProperties +--- + +## Examples + +{{}} +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "object", + "properties": { + "person": { + "type": "string", + "required": true + } + } +} +{{}} + +{{}} +{ "person": "John Doe" } +{{}} + +{{}} +{ age: 10 } +{{}} diff --git a/content/draft3/core/schema.markdown b/content/draft3/core/schema.markdown new file mode 100644 index 0000000..aaf5aee --- /dev/null +++ b/content/draft3/core/schema.markdown @@ -0,0 +1,19 @@ +--- +keyword: "$schema" +signature: "URI" +value: This keyword may be set to an absolute URI +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-03/draft-zyp-json-schema-03.pdf#5.29" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + description: Implementation dependent +index: -999 +introduced_in: draft3 +related: + - vocabulary: core + keyword: id + - vocabulary: core + keyword: definitions +--- diff --git a/content/draft3/core/title.markdown b/content/draft3/core/title.markdown new file mode 100644 index 0000000..2f9beaa --- /dev/null +++ b/content/draft3/core/title.markdown @@ -0,0 +1,17 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.21" +metaschema: "http://json-schema.org/draft-03/schema#" +introduced_in: draft1 +index: 9994 +related: + - vocabulary: core + keyword: description + - vocabulary: core + keyword: default +--- diff --git a/content/draft3/core/type.markdown b/content/draft3/core/type.markdown new file mode 100644 index 0000000..c553862 --- /dev/null +++ b/content/draft3/core/type.markdown @@ -0,0 +1,18 @@ +--- +keyword: "type" +signature: "String | Array | Any" +value: This keyword must be set to either a string that corresponds to one of the supported types, a *non-empty* array of unique strings that correspond to one of the supported types, or the value `any`. If the keyword is not defined or the value is not in the list of supported types, any type of value is acceptable. +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-03/draft-zyp-json-schema-03.pdf#5.1" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: "[ \"null\", \"boolean\", \"object\", \"array\", \"number\", \"string\", \"any\"]" +tests: + - draft3/type.json +index: -99999 +introduced_in: draft1 +changed_in: + - draft4 +--- diff --git a/content/draft3/core/uniqueItems.markdown b/content/draft3/core/uniqueItems.markdown new file mode 100644 index 0000000..96297d0 --- /dev/null +++ b/content/draft3/core/uniqueItems.markdown @@ -0,0 +1,21 @@ +--- +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-03/draft-zyp-json-schema-03.pdf#5.15" +metaschema: "http://json-schema.org/draft-03/schema#" +default: + value: false +tests: + - draft3/uniqueItems.json +introduced_in: draft2 +index: -95 +related: + - vocabulary: core + keyword: items + - vocabulary: core + keyword: additionalItems +--- diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 415c35b..facf111 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -201,7 +201,7 @@

{{ .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 in (slice "/draft4" "/draft6" "/draft7") $dialectURL }} + {{ if in (slice "/draft3" "/draft4" "/draft6" "/draft7") $dialectURL }} {{ else }} {{ if .Params.default }}