diff --git a/packages/apidom-ls/src/config/common/schema/completion.ts b/packages/apidom-ls/src/config/common/schema/completion.ts index f0374e433..2eac332bb 100644 --- a/packages/apidom-ls/src/config/common/schema/completion.ts +++ b/packages/apidom-ls/src/config/common/schema/completion.ts @@ -7,6 +7,20 @@ import { AsyncAPI2 } from '../../asyncapi/target-specs'; import { OpenAPI2, OpenAPI30, OpenAPI31, OpenAPI3 } from '../../openapi/target-specs'; const completion: ApidomCompletionItem[] = [ + { + label: 'type', + insertText: 'type', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of this keyword **MUST** be a string. \n\n ---- \n\nString values **MUST** be one of the five primitive types ("boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.\n\n ---- \n\nAn instance matches successfully if its primitive type is one of the types defined by keyword. Recall: "number" includes "integer".', + }, + targetSpecs: [...OpenAPI2, ...OpenAPI30], + }, { label: 'type', insertText: 'type', @@ -19,7 +33,21 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of this keyword **MUST** be either a string or an array. If it is an array, elements of the array **MUST** be strings and **MUST** be unique.\n\n ---- \n\nString values **MUST** be one of the six primitive types ("null", "boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.\n\n ---- \n\nAn instance validates if and only if the instance is in any of the sets listed for this keyword.\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI31], + }, + { + label: 'enum', + insertText: 'enum', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + "The value of this keyword **MUST** be an array. This array **SHOULD** have at least one element. Elements in the array **MUST** be unique. \n\n ---- \n\nAn instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.\n\n ---- \n\nElements in the array might be of any value, including null.\n\n ---- \n\n", + }, + targetSpecs: OpenAPI2, }, { label: 'enum', @@ -33,7 +61,7 @@ const completion: ApidomCompletionItem[] = [ value: "The value of this keyword **MUST** be an array. This array **SHOULD** have at least one element. Elements in the array **SHOULD** be unique.\n\n ---- \n\nAn instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.\n\n ---- \n\nElements in the array might be of any value, including null.\n\n ---- \n\n", }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { label: 'const', @@ -75,7 +103,35 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of "maximum" **MUST** be a number, representing an inclusive upper limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: OpenAPI2, + }, + { + label: 'maximum', + insertText: 'maximum', + kind: 14, + format: CompletionFormat.UNQUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of "maximum" MUST be a JSON number.\n\n ---- \n\nIf "exclusiveMaximum" is not present, or has boolean value false, then the instance is valid if it is lower than, or equal to, the value of "maximum".\n\n ---- \n\nIf "exclusiveMaximum" has boolean value true, the instance is valid if it is strictly lower than the value of "maximum".', + }, + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + label: 'exclusiveMaximum', + insertText: 'exclusiveMaximum', + kind: 14, + format: CompletionFormat.UNQUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of "exclusiveMaximum" MUST be a boolean. If "exclusiveMaximum" is present, "maximum" MUST also be present.\n\n ---- \n\nIf "exclusiveMaximum" is has boolean value false, then the instance is valid if it is lower than, or equal to, the value of "maximum".\n\n ---- \n\nIf "exclusiveMaximum" has boolean value true, the instance is valid if it is strictly lower than the value of "maximum".', + }, + targetSpecs: OpenAPI2, }, { label: 'exclusiveMaximum', @@ -89,7 +145,21 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of "exclusiveMaximum" **MUST** be number, representing an exclusive upper limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + label: 'minimum', + insertText: 'minimum', + kind: 14, + format: CompletionFormat.UNQUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of "minimum" MUST be a JSON number.\n\n ---- \n\nIf "exclusiveMinimum" is not present, or has boolean value false, then the instance is valid if it is greater than, or equal to, the value of "minimum.\n\n ---- \n\nIf "exclusiveMinimum" is present and has boolean value true, the instance is valid if it is strictly greater than the value of "minimum".', + }, + targetSpecs: OpenAPI2, }, { label: 'minimum', @@ -103,7 +173,21 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of "minimum" **MUST** be a number, representing an inclusive lower limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + label: 'exclusiveMinimum', + insertText: 'exclusiveMinimum', + kind: 14, + format: CompletionFormat.UNQUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of "exclusiveMinimum" MUST be a boolean. If "exclusiveMinimum" is present, "minimum" MUST also be present.\n\n ---- \n\nIf "exclusiveMinimum" is has boolean value false, then the instance is valid if it is greater than, or equal to, the value of "minimum.\n\n ---- \n\nIf "exclusiveMinimum" is present and has boolean value true, the instance is valid if it is strictly greater than the value of "minimum".', + }, + targetSpecs: OpenAPI2, }, { label: 'exclusiveMinimum', @@ -117,7 +201,7 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of "exclusiveMinimum" **MUST** be number, representing an exclusive lower limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { label: 'maxLength', @@ -273,6 +357,20 @@ const completion: ApidomCompletionItem[] = [ }, targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, + { + label: '$ref', + insertText: '\\$ref', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'Any time a subschema is expected, a schema may instead use an object containing a "$ref" property. The value of the $ref is a URI Reference. Resolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object MUST be ignored.', + }, + targetSpecs: OpenAPI2, + }, { label: '$ref', insertText: '\\$ref', @@ -285,7 +383,21 @@ const completion: ApidomCompletionItem[] = [ value: 'The "$ref" keyword is used to reference a schema, and provides the ability to validate recursive structures through self-reference. \n\n ---- \n\nAn object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref" property **MUST** be a URI Reference. \n\n ---- \n\nResolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object **MUST** be ignored. \n\n ---- \n\nThe URI is not a network locator, only an identifier. A schema need not be downloadable from the address if it is a network-addressable URL, and implementations **SHOULD NOT** assume they should perform a network operation when they encounter a network-addressable URI. \n\n ---- \n\nA schema **MUST NOT** be run into an infinite loop against a schema. For example, if two schemas "#alice" and "#bob" both have an "allOf" property that refers to the other, a naive validator might get stuck in an infinite recursive loop trying to validate the instance. Schemas **SHOULD NOT** make use of infinite recursive nesting like this; the behavior is undefined.`.\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + label: 'required', + insertText: 'required', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + "The value of this keyword MUST be an array. This array MUST have at least one element. Elements of this array MUST be strings, and MUST be unique.\n\n ---- \n\nAn object instance is valid against this keyword if its property set contains all elements in this keyword's array value.", + }, + targetSpecs: OpenAPI2, }, { label: 'required', @@ -299,9 +411,8 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of this keyword **MUST** be an array. Elements of this array, if any, **MUST** be strings, and **MUST** be unique.\n\n ---- \n\nAn object instance is valid against this keyword if every item in the array is the name of a property in the instance.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty array.\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, - { label: 'properties', insertText: 'properties', @@ -330,6 +441,20 @@ const completion: ApidomCompletionItem[] = [ }, targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, + { + label: 'additionalProperties', + insertText: 'additionalProperties', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of "additionalProperties" **MUST** be a boolean or an object. If it is an object, it MUST also be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n ---- \n\nValidation with "additionalProperties" applies only to the child values of instance names that do not match any names in "properties".\n\n ---- \n\nFor all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + }, + targetSpecs: OpenAPI2, + }, { label: 'additionalProperties', insertText: 'additionalProperties', @@ -342,7 +467,7 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of "additionalProperties" **MUST** be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n ---- \n\nValidation with "additionalProperties" applies only to the child values of instance names that do not match any names in "properties", and do not match any regular expression in "patternProperties".\n\n ---- \n\nFor all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { label: 'propertyNames', @@ -493,7 +618,8 @@ const completion: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: 'A free-form property to include an example of an instance for this schema.', + value: + 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema.', }, targetSpecs: OpenAPI2, }, @@ -507,7 +633,7 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.', + 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.', }, targetSpecs: OpenAPI30, }, @@ -521,7 +647,7 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n\n**Deprecated:** The `example` property has been deprecated in favor of the JSON Schema `examples` keyword. Use of `example` is discouraged, and later versions of this specification may remove it.', + 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n\\\n\\\n**Deprecated:** The `example` property has been deprecated in favor of the JSON Schema `examples` keyword. Use of `example` is discouraged, and later versions of this specification may remove it.', }, targetSpecs: OpenAPI31, }, @@ -537,7 +663,7 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of this keyword **MUST** be an array. There are no restrictions placed on the values within the array. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations **MUST** provide a flat array of all values rather than an array of arrays.\n\n ---- \n\nThis keyword can be used to provide sample JSON values associated with a particular schema, for the purpose of illustrating usage. It is RECOMMENDED that these values be valid against the associated schema.\n\n ---- \n\nImplementations **MAY** use the value(s) of "default", if present, as an additional example. If "examples" is absent, "default" **MAY** still be used in this manner.\n\n ---- \n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI31], }, { label: 'format', @@ -637,6 +763,20 @@ const completion: ApidomCompletionItem[] = [ }, targetSpecs: AsyncAPI2, }, + { + label: 'readOnly', + insertText: 'readOnly', + kind: 14, + format: CompletionFormat.UNQUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'The value of these keywords **MUST** be a boolean. Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as `readOnly` being `true` SHOULD NOT be in the `required` list of the defined schema. Default value is `false`.', + }, + targetSpecs: OpenAPI2, + }, { label: 'readOnly', insertText: 'readOnly', @@ -649,7 +789,7 @@ const completion: ApidomCompletionItem[] = [ value: 'The value of these keywords **MUST** be a boolean. When multiple occurrences of these keywords are applicable to a single sub-instance, the resulting value **MUST** be true if any occurrence specifies a true value, and **MUST** be false otherwise.\n\n ---- \n\nIf "readOnly" has a value of boolean true, it 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.\n\n ---- \n\nAn instance document that is marked as "readOnly for the entire document **MAY** be ignored if sent to the owning authority, or **MAY** result in an error, at the authority \'s discretion.\n\n ---- \n\nIf "writeOnly" has a value of boolean true, it indicates that the value is never present when the instance is retrieved from the owning authority. It can be present when sent to the owning authority to update or create the document (or the resource it represents), but it will not be included in any updated or newly created version of the instance.\n\n ---- \n\nAn instance document that is marked as "writeOnly" for the entire document **MAY** be returned as a blank document of some sort, or **MAY** produce an error upon retrieval, or have the retrieval request ignored, at the authority \'s discretion.\n\n ---- \n\nFor example, "readOnly" would be used to mark a database-generated serial number as read-only, while "writeOnly" would be used to mark a password input field.\n\n ---- \n\nThese keywords can be used to assist in user interface instance generation. In particular, an application **MAY** choose to use a widget that hides input values as they are typed for write-only fields.\n\n ---- \n\nOmitting these keywords has the same behavior as values of false.\n\n', }, - targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { label: 'writeOnly', @@ -1270,7 +1410,7 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaComposition) for more details.', + '[Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminatorObject)\n\\\n\\\nAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaComposition) for more details.', }, targetSpecs: OpenAPI30, }, @@ -1284,7 +1424,7 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaComposition) for more details.', + '[Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminatorObject)\n\\\n\\\nAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaComposition) for more details.', }, targetSpecs: OpenAPI31, }, @@ -1342,9 +1482,51 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.', + '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.', }, - targetSpecs: [...OpenAPI2, ...OpenAPI3], + targetSpecs: OpenAPI2, + }, + { + label: 'xml', + insertText: 'xml', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.', + }, + targetSpecs: OpenAPI30, + }, + { + label: 'xml', + insertText: 'xml', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.', + }, + targetSpecs: OpenAPI31, + }, + { + label: 'externalDocs', + insertText: 'externalDocs', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', + }, + targetSpecs: OpenAPI2, }, { label: 'externalDocs', @@ -1355,9 +1537,10 @@ const completion: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: 'Additional external documentation for this schema.', + value: + 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', }, - targetSpecs: [...OpenAPI2, ...OpenAPI3], + targetSpecs: OpenAPI30, }, { label: 'externalDocs', @@ -1368,9 +1551,10 @@ const completion: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: 'Additional external documentation for this schema.', + value: + 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', }, - targetSpecs: [...OpenAPI2, ...OpenAPI3], + targetSpecs: OpenAPI31, }, { label: 'externalDocs', @@ -1382,7 +1566,7 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Allows referencing an external resource for extended documentation. See [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.6.0#externalDocumentationObject)\n', + 'External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.6.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', }, targetSpecs: AsyncAPI2, }, diff --git a/packages/apidom-ls/src/config/common/schema/documentation.ts b/packages/apidom-ls/src/config/common/schema/documentation.ts index 684ee3fa2..6afd6aa57 100644 --- a/packages/apidom-ls/src/config/common/schema/documentation.ts +++ b/packages/apidom-ls/src/config/common/schema/documentation.ts @@ -1,211 +1,350 @@ +import { AsyncAPI2 } from '../../asyncapi/target-specs'; +import { OpenAPI2, OpenAPI31, OpenAPI30, OpenAPI3 } from '../../openapi/target-specs'; + const documentation = [ + { + target: 'type', + docs: 'The value of this keyword **MUST** be a string. \n\n ---- \n\nString values **MUST** be one of the five primitive types ("boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.\n\n ---- \n\nAn instance matches successfully if its primitive type is one of the types defined by keyword. Recall: "number" includes "integer".', + targetSpecs: [...OpenAPI2, ...OpenAPI30], + }, { target: 'type', docs: 'The value of this keyword **MUST** be either a string or an array. If it is an array, elements of the array **MUST** be strings and **MUST** be unique.\n\n ---- \n\nString values **MUST** be one of the six primitive types ("null", "boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.\n\n ---- \n\nAn instance validates if and only if the instance is in any of the sets listed for this keyword.', + targetSpecs: [...AsyncAPI2, ...OpenAPI31], + }, + { + target: 'enum', + docs: "The value of this keyword **MUST** be an array. This array **SHOULD** have at least one element. Elements in the array **MUST** be unique. \n\n ---- \n\nAn instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.\n\n ---- \n\nElements in the array might be of any value, including null.\n\n ---- \n\n", + targetSpecs: OpenAPI2, }, { target: 'enum', docs: "The value of this keyword **MUST** be an array. This array **SHOULD** have at least one element. Elements in the array **SHOULD** be unique.\n\n ---- \n\nAn instance validates successfully against this keyword if its value is equal to one of the elements in this keyword's array value.\n\n ---- \n\nElements in the array might be of any value, including null.\n\n ---- \n\n", + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'const', docs: 'The value of this keyword **MAY** be of any type, including null.\n\n ---- \n\nAn instance validates successfully against this keyword if its value is equal to the value of the keyword.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'multipleOf', docs: 'The value of "multipleOf" **MUST** be a number, strictly greater than 0.\n\n ---- \n\nA numeric instance is valid only if division by this keyword\'s value results in an integer.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + }, + { + target: 'maximum', + docs: 'The value of "maximum" MUST be a JSON number.\n\n ---- \n\nIf "exclusiveMaximum" is not present, or has boolean value false, then the instance is valid if it is lower than, or equal to, the value of "maximum".\n\n ---- \n\nIf "exclusiveMaximum" has boolean value true, the instance is valid if it is strictly lower than the value of "maximum".', + targetSpecs: OpenAPI2, }, { target: 'maximum', docs: 'The value of "maximum" **MUST** be a number, representing an inclusive upper limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: 'exclusiveMaximum', + docs: 'The value of "exclusiveMaximum" MUST be a boolean. If "exclusiveMaximum" is present, "maximum" MUST also be present.\n\n ---- \n\nIf "exclusiveMaximum" is has boolean value false, then the instance is valid if it is lower than, or equal to, the value of "maximum".\n\n ---- \n\nIf "exclusiveMaximum" has boolean value true, the instance is valid if it is strictly lower than the value of "maximum".', + targetSpecs: OpenAPI2, }, { target: 'exclusiveMaximum', docs: 'The value of "exclusiveMaximum" **MUST** be number, representing an exclusive upper limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: 'minimum', + docs: 'The value of "minimum" MUST be a JSON number.\n\n ---- \n\nIf "exclusiveMinimum" is not present, or has boolean value false, then the instance is valid if it is greater than, or equal to, the value of "minimum.\n\n ---- \n\nIf "exclusiveMinimum" is present and has boolean value true, the instance is valid if it is strictly greater than the value of "minimum".', + targetSpecs: OpenAPI2, }, { target: 'minimum', docs: 'The value of "minimum" **MUST** be a number, representing an inclusive lower limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: 'exclusiveMinimum', + docs: 'The value of "exclusiveMinimum" MUST be a boolean. If "exclusiveMinimum" is present, "minimum" MUST also be present.\n\n ---- \n\nIf "exclusiveMinimum" is has boolean value false, then the instance is valid if it is greater than, or equal to, the value of "minimum.\n\n ---- \n\nIf "exclusiveMinimum" is present and has boolean value true, the instance is valid if it is strictly greater than the value of "minimum".', + targetSpecs: OpenAPI2, }, { target: 'exclusiveMinimum', docs: 'The value of "exclusiveMinimum" **MUST** be number, representing an exclusive lower limit for a numeric instance.\n\n ---- \n\nIf the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'maxLength', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nA string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.\n\n ---- \n\nThe length of a string instance is defined as the number of its characters as defined by RFC 7159.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'minLength', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nA string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.\n\n ---- \n\nThe length of a string instance is defined as the number of its characters as defined by RFC 7159.\n\n ---- \n\nOmitting this keyword has the same behavior as a value of 0.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'pattern', docs: 'The value of this keyword **MUST** be a string. This string **SHOULD** be a valid regular expression, according to the ECMA 262 regular expression dialect.\n\n ---- \n\nA string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'items', docs: 'The value of "items" **MUST** be either a valid JSON Schema or an array of valid JSON Schemas.\n\n ---- \n\nThis keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.\n\n ---- \n\nIf "items" is a schema, validation succeeds if all elements in the array successfully validate against that schema.\n\n ---- \n\nIf "items" is an array of schemas, validation succeeds if each element of the instance validates against the schema at the same position, if any.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'additionalItems', docs: 'The value of "additionalItems" **MUST** be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.\n\n ---- \n\nIf "items" is an array of schemas, validation succeeds if every instance element at a position greater than the size of "items" validates against "additionalItems".\n\n ---- \n\nOtherwise, "additionalItems" **MUST** be ignored, as the "items" schema (possibly the default value of an empty schema) is applied to all elements.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'maxItems', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nAn array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'minItems', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nAn array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.\n\n ---- \n\nOmitting this keyword has the same behavior as a value of 0.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'uniqueItems', docs: 'The value of this keyword **MUST** be a boolean.\n\n ---- \n\nIf this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.\n\n ---- \n\nOmitting this keyword has the same behavior as a value of false.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'contains', docs: 'The value of this keyword **MUST** be a valid JSON Schema.\n\n ---- \n\nAn array instance is valid against "contains" if at least one of its elements is valid against the given schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'maxProperties', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nAn object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'minProperties', docs: 'The value of this keyword **MUST** be a non-negative integer.\n\n ---- \n\nAn object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword.\n\n ---- \n\nOmitting this keyword has the same behavior as a value of 0.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + }, + { + target: 'required', + docs: "The value of this keyword MUST be an array. This array MUST have at least one element. Elements of this array MUST be strings, and MUST be unique.\n\n ---- \n\nAn object instance is valid against this keyword if its property set contains all elements in this keyword's array value.", + targetSpecs: OpenAPI2, }, { target: 'required', docs: 'The value of this keyword **MUST** be an array. Elements of this array, if any, **MUST** be strings, and **MUST** be unique.\n\n ---- \n\nAn object instance is valid against this keyword if every item in the array is the name of a property in the instance.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty array.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'properties', docs: 'The value of "properties" **MUST** be an object. Each value of this object **MUST** be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n ---- \n\nValidation 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.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty object.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'patternProperties', docs: 'The value of "patternProperties" **MUST** be an object. Each property name of this object **SHOULD** be a valid regular expression, according to the ECMA 262 regular expression dialect. Each property value of this object **MUST** be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. Validation of the primitive instance type against this keyword always succeeds.\n\n ---- \n\nValidation 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.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty object.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: 'additionalProperties', + docs: 'The value of "additionalProperties" **MUST** be a boolean or an object. If it is an object, it MUST also be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n ---- \n\nValidation with "additionalProperties" applies only to the child values of instance names that do not match any names in "properties".\n\n ---- \n\nFor all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + targetSpecs: OpenAPI2, }, { target: 'additionalProperties', docs: 'The value of "additionalProperties" **MUST** be a valid JSON Schema.\n\n ---- \n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n ---- \n\nValidation with "additionalProperties" applies only to the child values of instance names that do not match any names in "properties", and do not match any regular expression in "patternProperties".\n\n ---- \n\nFor all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'propertyNames', docs: 'The value of "propertyNames" **MUST** be a valid JSON Schema.\n\n ---- \n\nIf the instance is an object, this keyword validates if every property name in the instance validates against the provided schema. Note the property name that the schema is testing will always be a string.\n\n ---- \n\nOmitting this keyword has the same behavior as an empty schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'if', docs: 'This keyword\'s value **MUST** be a valid JSON Schema.\n\n ---- \n\nThis validation outcome of this keyword\'s subschema has no direct effect on the overall validation result. Rather, it controls which of the "then" or "else" keywords are evaluated.\n\n ---- \n\nInstances that successfully validate against this keyword\'s subschema **MUST** also be valid against the subschema value of the "then" keyword, if present.\n\n ---- \n\nInstances that fail to validate against this keyword\'s subschema **MUST** also be valid against the subschema value of the "else" keyword, if present.\n\n ---- \n\nIf annotations (Section 3.3) are being collected, they are collected from this keyword\'s subschema in the usual way, including when the keyword is present without either "then" or "else".', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'then', docs: 'This keyword\'s value **MUST** be a valid JSON Schema.\n\n ---- \n\nWhen "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.\n\n ---- \n\nThis keyword has no effect when "if" is absent, or when the instance fails to validate against its subschema. Implementations **MUST** NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'else', docs: 'This keyword\'s value **MUST** be a valid JSON Schema.\n\n ---- \n\nWhen "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.\n\n ---- \n\nThis keyword has no effect when "if" is absent, or when the instance successfully validates against its subschema. Implementations **MUST** NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'allOf', docs: "This keyword's value **MUST** be a non-empty array. Each item of the array **MUST** be a valid JSON Schema.\n\n ---- \n\nAn instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword's value.\n\n ---- \n\n", + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'anyOf', docs: "This keyword's value **MUST** be a non-empty array. Each item of the array **MUST** be a valid JSON Schema.\n\n ---- \n\nAn instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword's value.\n\n ---- \n\n", + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'oneOf', docs: "This keyword's value **MUST** be a non-empty array. Each item of the array **MUST** be a valid JSON Schema.\n\n ---- \n\nAn instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword's value.\n\n ---- \n\n", + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'not', docs: "This keyword's value **MUST** be a valid JSON Schema.\n\n ---- \n\nAn instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.\n\n ---- \n\n", + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'contentEncoding', docs: 'If the instance value is a string, this property defines that the string **SHOULD** be interpreted as binary data and decoded using the encoding named by this property. RFC 2045, Sec 6.1 lists the possible values for this property.\n\n ---- \n\nThe value of this property **MUST** be a string.\n\n ---- \n\nThe value of this property **SHOULD** be ignored if the instance described is not a string.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'contentMediaType', docs: 'The value of this property **must** be a media type, as defined by RFC 2046. This property defines the media type of instances which this schema defines.\n\n ---- \n\nThe value of this property **MUST** be a string.\n\n ---- \n\nThe value of this property **SHOULD** be ignored if the instance described is not a string.\n\n ---- \n\nIf the "contentEncoding" property is not present, but the instance value is a string, then the value of this property **SHOULD** specify a text document type, and the character set **SHOULD** be the character set into which the JSON string value was decoded (for which the default is Unicode).', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: 'example', + docs: 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema.', + targetSpecs: OpenAPI2, + }, + { + target: 'example', + docs: 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.', + targetSpecs: OpenAPI30, + }, + { + target: 'example', + docs: 'Any\n\\\n\\\nA free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n\\\n\\\n**Deprecated:** The `example` property has been deprecated in favor of the JSON Schema `examples` keyword. Use of `example` is discouraged, and later versions of this specification may remove it.', + targetSpecs: OpenAPI31, }, { target: 'examples', docs: 'The value of this keyword **MUST** be an array. There are no restrictions placed on the values within the array. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations **MUST** provide a flat array of all values rather than an array of arrays.\n\n ---- \n\nThis keyword can be used to provide sample JSON values associated with a particular schema, for the purpose of illustrating usage. It is RECOMMENDED that these values be valid against the associated schema.\n\n ---- \n\nImplementations **MAY** use the value(s) of "default", if present, as an additional example. If "examples" is absent, "default" **MAY** still be used in this manner.', + targetSpecs: [...AsyncAPI2, ...OpenAPI31], }, { target: 'format', - docs: 'Structural validation alone **may** be insufficient to validate that an instance meets all the requirements of an application. The "format" keyword is defined to allow interoperable semantic validation for a fixed subset of values which are accurately described by authoritative resources, be they RFCs or other external specifications. \n\n ---- \n\nThe value of this keyword is called a format attribute. It **MUST** be a string. A format attribute can generally only validate a given set of instance types. If the type of the instance to validate is not in this set, validation for this format attribute and instance **SHOULD** succeed.', + docs: 'Structural validation alone **may** be insufficient to validate that an instance meets all the requirements of an application. The "format" keyword is defined to allow interoperable semantic validation for a fixed subset of values which are accurately described by authoritative resources, be they RFCs or other external specifications. \n\n ---- \n\nThe value of this keyword is called a format attribute. It **MUST** be a string. A format attribute can generally only validate a given set of instance types. If the type of the instance to validate is not in this set, validation for this format attribute and instance **SHOULD** succeed.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'title', docs: 'The value of "title" and "description" **MUST** be a string. \n\n ---- \n\nBoth of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], }, { target: 'description', docs: 'The value of "title" and "description" **MUST** be a string. \n\n ---- \n\nBoth of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.', + targetSpecs: [...AsyncAPI2, ...OpenAPI2, ...OpenAPI3], + }, + { + target: 'default', + docs: 'Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object.', + targetSpecs: OpenAPI2, }, { target: 'default', - targetSpecs: [ - { namespace: 'asyncapi', version: '2.0.0' }, - { namespace: 'asyncapi', version: '2.1.0' }, - { namespace: 'asyncapi', version: '2.2.0' }, - { namespace: 'asyncapi', version: '2.3.0' }, - { namespace: 'asyncapi', version: '2.4.0' }, - ], docs: 'The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, of `type` is `string`, then `default` can be `"foo"` but cannot be `1`.', + targetSpecs: AsyncAPI2, }, { target: 'default', - targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], docs: 'There are no restrictions placed on the value of this keyword. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations **SHOULD** remove duplicates.\n\n ---- \n\nThis keyword can be used to supply a default JSON value associated with a particular schema. It is **RECOMMENDED** that a default value be valid against the associated schema.', + targetSpecs: OpenAPI31, + }, + { + target: 'readOnly', + docs: 'The value of these keywords **MUST** be a boolean. Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as `readOnly` being `true` SHOULD NOT be in the `required` list of the defined schema. Default value is `false`.', + targetSpecs: OpenAPI2, }, { target: 'readOnly', docs: 'The value of these keywords **MUST** be a boolean. When multiple occurrences of these keywords are applicable to a single sub-instance, the resulting value **MUST** be true if any occurrence specifies a true value, and **MUST** be false otherwise. \n\n ---- \n\nIf "readOnly" has a value of boolean true, it 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. \n\n ---- \n\nAn instance document that is marked as "readOnly for the entire document **MAY** be ignored if sent to the owning authority, or **MAY** result in an error, at the authority \'s discretion. \n\n ---- \n\nIf "writeOnly" has a value of boolean true, it indicates that the value is never present when the instance is retrieved from the owning authority. It can be present when sent to the owning authority to update or create the document (or the resource it represents), but it will not be included in any updated or newly created version of the instance. \n\n ---- \n\nAn instance document that is marked as "writeOnly" for the entire document **MAY** be returned as a blank document of some sort, or **MAY** produce an error upon retrieval, or have the retrieval request ignored, at the authority \'s discretion. \n\n ---- \n\nFor example, "readOnly" would be used to mark a database-generated serial number as read-only, while "writeOnly" would be used to mark a password input field. \n\n ---- \n\nThese keywords can be used to assist in user interface instance generation. In particular, an application **MAY** choose to use a widget that hides input values as they are typed for write-only fields. \n\n ---- \n\nOmitting these keywords has the same behavior as values of false.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'writeOnly', docs: 'The value of these keywords **MUST** be a boolean. When multiple occurrences of these keywords are applicable to a single sub-instance, the resulting value **MUST** be true if any occurrence specifies a true value, and **MUST** be false otherwise. \n\n ---- \n\nIf "readOnly" has a value of boolean true, it 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. \n\n ---- \n\nAn instance document that is marked as "readOnly for the entire document **MAY** be ignored if sent to the owning authority, or **MAY** result in an error, at the authority \'s discretion. \n\n ---- \n\nIf "writeOnly" has a value of boolean true, it indicates that the value is never present when the instance is retrieved from the owning authority. It can be present when sent to the owning authority to update or create the document (or the resource it represents), but it will not be included in any updated or newly created version of the instance. \n\n ---- \n\nAn instance document that is marked as "writeOnly" for the entire document **MAY** be returned as a blank document of some sort, or **MAY** produce an error upon retrieval, or have the retrieval request ignored, at the authority \'s discretion. \n\n ---- \n\nFor example, "readOnly" would be used to mark a database-generated serial number as read-only, while "writeOnly" would be used to mark a password input field. \n\n ---- \n\nThese keywords can be used to assist in user interface instance generation. In particular, an application **MAY** choose to use a widget that hides input values as they are typed for write-only fields. \n\n ---- \n\nOmitting these keywords has the same behavior as values of false.', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { target: 'discriminator', - docs: 'Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it. See [Composition and Inheritance](https://www.asyncapi.com/docs/reference/specification/v2.4.0#schemaComposition) for more details.', - targetSpecs: [ - { namespace: 'asyncapi', version: '2.0.0' }, - { namespace: 'asyncapi', version: '2.1.0' }, - { namespace: 'asyncapi', version: '2.2.0' }, - { namespace: 'asyncapi', version: '2.3.0' }, - { namespace: 'asyncapi', version: '2.4.0' }, - ], + docs: 'Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it.', + targetSpecs: OpenAPI2, }, { target: 'discriminator', - docs: '[Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminatorObject)\\n\\\\\\n\\\\\\nAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaComposition) for more details.', - targetSpecs: [ - { namespace: 'openapi', version: '3.0.0' }, - { namespace: 'openapi', version: '3.0.1' }, - { namespace: 'openapi', version: '3.0.2' }, - { namespace: 'openapi', version: '3.0.3' }, - ], + docs: '[Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminatorObject)\n\\\n\\\nAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaComposition) for more details.', + targetSpecs: OpenAPI30, + }, + { + target: 'discriminator', + docs: '[Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminatorObject)\n\\\n\\\nAdds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaComposition) for more details.', + targetSpecs: OpenAPI30, + }, + { + target: 'discriminator', + docs: 'Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it. See [Composition and Inheritance](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaComposition) for more details.', + targetSpecs: AsyncAPI2, + }, + { + target: 'xml', + docs: '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.', + targetSpecs: OpenAPI2, + }, + { + target: 'xml', + docs: '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.', + targetSpecs: OpenAPI30, + }, + { + target: 'xml', + docs: '[XML Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#xmlObject)\n\\\n\\\nThis MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.', + targetSpecs: OpenAPI31, + }, + { + target: 'externalDocs', + docs: 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', + targetSpecs: OpenAPI2, }, { target: 'externalDocs', - docs: 'Allows referencing an external resource for extended documentation. See [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#externalDocumentationObject)\n', + docs: 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', + targetSpecs: OpenAPI30, + }, + { + target: 'externalDocs', + docs: 'External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', + targetSpecs: OpenAPI31, + }, + { + target: 'externalDocs', + docs: 'External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.6.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this schema.', + targetSpecs: AsyncAPI2, }, { target: 'deprecated', docs: 'Specifies that a schema is deprecated and **SHOULD** be transitioned out of usage. Default value is `false`.\n', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], + }, + { + target: '$ref', + docs: 'Any time a subschema is expected, a schema may instead use an object containing a "$ref" property. The value of the $ref is a URI Reference. Resolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object MUST be ignored.', + targetSpecs: OpenAPI2, }, { target: '$ref', docs: 'The "$ref" keyword is used to reference a schema, and provides the ability to validate recursive structures through self-reference. \n\n ---- \n\nAn object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref" property **MUST** be a URI Reference. \n\n ---- \n\nResolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object **MUST** be ignored. \n\n ---- \n\nThe URI is not a network locator, only an identifier. A schema need not be downloadable from the address if it is a network-addressable URL, and implementations **SHOULD NOT** assume they should perform a network operation when they encounter a network-addressable URI. \n\n ---- \n\nA schema **MUST NOT** be run into an infinite loop against a schema. For example, if two schemas "#alice" and "#bob" both have an "allOf" property that refers to the other, a naive validator might get stuck in an infinite recursive loop trying to validate the instance. Schemas **SHOULD NOT** make use of infinite recursive nesting like this; the behavior is undefined.`.\n', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, { docs: ' JSON Schema Validation: A Vocabulary for Structural Validation of JSON\n\n\n\nInternet Engineering Task Force\n\n\n\nA. Wright, Ed.\n\n\n\nInternet-Draft\n\n\n\nIntended status: Informational\n\n\n\nH. Andrews, Ed.\n\n\n\nExpires: September 20, 2018\n\n\n\nCloudflare, Inc.\n\n\n\nG. Luff\n\n\n\nMarch 19, 2018\n\n\n\nJSON Schema Validation: A Vocabulary for Structural Validation of JSON\n\ndraft-handrews-json-schema-validation-01\n\n\n\n[Abstract](#rfc.abstract)\n\n=========================\n\n\n\nJSON Schema (application/schema+json) has several purposes, one of which is JSON instance validation. This document specifies a vocabulary for JSON Schema to describe the meaning of JSON documents, provide hints for user interfaces working with JSON data, and to make assertions about what a valid document must look like.\n\n\n\nNote to Readers\n\n===============\n\n\n\nThe issues list for this draft can be found at <[https://github.com/json-schema-org/json-schema-spec/issues](https://github.com/json-schema-org/json-schema-spec/issues)\\>.\n\n\n\nFor additional information, see <[http://json-schema.org/](http://json-schema.org/)\\>.\n\n\n\nTo provide feedback, use this issue tracker, the communication methods listed on the homepage, or email the document editors.\n\n\n\n[Status of This Memo](#rfc.status)\n\n==================================\n\n\n\nThis Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.\n\n\n\nInternet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n\n\nInternet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."\n\n\n\nThis Internet-Draft will expire on September 20, 2018.\n\n\n\n[Copyright Notice](#rfc.copyrightnotice)\n\n========================================\n\n\n\nCopyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.\n\n\n\nThis document is subject to BCP 78 and the IETF Trust\'s Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.\n\n\n\n* * *\n\n\n\n[Table of Contents](#rfc.toc)\n\n=============================\n\n\n\n* 1\\. [Introduction](#rfc.section.1)\n\n* 2\\. [Conventions and Terminology](#rfc.section.2)\n\n* 3\\. [Overview](#rfc.section.3)\n\n\n\n* 3.1. [Applicability](#rfc.section.3.1)\n\n\n\n* 3.1.1. [Keyword Independence](#rfc.section.3.1.1)\n\n\n\n* 3.2. [Assertions](#rfc.section.3.2)\n\n\n\n* 3.2.1. [Assertions and Instance Primitive Types](#rfc.section.3.2.1)\n\n\n\n* 3.3. [Annotations](#rfc.section.3.3)\n\n\n\n* 3.3.1. [Annotations and Validation Outcomes](#rfc.section.3.3.1)\n\n* 3.3.2. [Annotations and Short-Circuit Validation](#rfc.section.3.3.2)\n\n\n\n* 4\\. [Interoperability Considerations](#rfc.section.4)\n\n\n\n* 4.1. [Validation of String Instances](#rfc.section.4.1)\n\n* 4.2. [Validation of Numeric Instances](#rfc.section.4.2)\n\n* 4.3. [Regular Expressions](#rfc.section.4.3)\n\n\n\n* 5\\. [Meta-Schema](#rfc.section.5)\n\n* 6\\. [Validation Keywords](#rfc.section.6)\n\n\n\n* 6.1. [Validation Keywords for Any Instance Type](#rfc.section.6.1)\n\n\n\n* 6.1.1. [type](#rfc.section.6.1.1)\n\n* 6.1.2. [enum](#rfc.section.6.1.2)\n\n* 6.1.3. [const](#rfc.section.6.1.3)\n\n\n\n* 6.2. [Validation Keywords for Numeric Instances (number and integer)](#rfc.section.6.2)\n\n\n\n* 6.2.1. [multipleOf](#rfc.section.6.2.1)\n\n* 6.2.2. [maximum](#rfc.section.6.2.2)\n\n* 6.2.3. [exclusiveMaximum](#rfc.section.6.2.3)\n\n* 6.2.4. [minimum](#rfc.section.6.2.4)\n\n* 6.2.5. [exclusiveMinimum](#rfc.section.6.2.5)\n\n\n\n* 6.3. [Validation Keywords for Strings](#rfc.section.6.3)\n\n\n\n* 6.3.1. [maxLength](#rfc.section.6.3.1)\n\n* 6.3.2. [minLength](#rfc.section.6.3.2)\n\n* 6.3.3. [pattern](#rfc.section.6.3.3)\n\n\n\n* 6.4. [Validation Keywords for Arrays](#rfc.section.6.4)\n\n\n\n* 6.4.1. [items](#rfc.section.6.4.1)\n\n* 6.4.2. [additionalItems](#rfc.section.6.4.2)\n\n* 6.4.3. [maxItems](#rfc.section.6.4.3)\n\n* 6.4.4. [minItems](#rfc.section.6.4.4)\n\n* 6.4.5. [uniqueItems](#rfc.section.6.4.5)\n\n* 6.4.6. [contains](#rfc.section.6.4.6)\n\n\n\n* 6.5. [Validation Keywords for Objects](#rfc.section.6.5)\n\n\n\n* 6.5.1. [maxProperties](#rfc.section.6.5.1)\n\n* 6.5.2. [minProperties](#rfc.section.6.5.2)\n\n* 6.5.3. [required](#rfc.section.6.5.3)\n\n* 6.5.4. [properties](#rfc.section.6.5.4)\n\n* 6.5.5. [patternProperties](#rfc.section.6.5.5)\n\n* 6.5.6. [additionalProperties](#rfc.section.6.5.6)\n\n* 6.5.7. [dependencies](#rfc.section.6.5.7)\n\n* 6.5.8. [propertyNames](#rfc.section.6.5.8)\n\n\n\n* 6.6. [Keywords for Applying Subschemas Conditionally](#rfc.section.6.6)\n\n\n\n* 6.6.1. [if](#rfc.section.6.6.1)\n\n* 6.6.2. [then](#rfc.section.6.6.2)\n\n* 6.6.3. [else](#rfc.section.6.6.3)\n\n\n\n* 6.7. [Keywords for Applying Subschemas With Boolean Logic](#rfc.section.6.7)\n\n\n\n* 6.7.1. [allOf](#rfc.section.6.7.1)\n\n* 6.7.2. [anyOf](#rfc.section.6.7.2)\n\n* 6.7.3. [oneOf](#rfc.section.6.7.3)\n\n* 6.7.4. [not](#rfc.section.6.7.4)\n\n\n\n* 7\\. [Semantic Validation With "format"](#rfc.section.7)\n\n\n\n* 7.1. [Foreword](#rfc.section.7.1)\n\n* 7.2. [Implementation Requirements](#rfc.section.7.2)\n\n* 7.3. [Defined Formats](#rfc.section.7.3)\n\n\n\n* 7.3.1. [Dates and Times](#rfc.section.7.3.1)\n\n* 7.3.2. [Email Addresses](#rfc.section.7.3.2)\n\n* 7.3.3. [Hostnames](#rfc.section.7.3.3)\n\n* 7.3.4. [IP Addresses](#rfc.section.7.3.4)\n\n* 7.3.5. [Resource Identifiers](#rfc.section.7.3.5)\n\n* 7.3.6. [uri-template](#rfc.section.7.3.6)\n\n* 7.3.7. [JSON Pointers](#rfc.section.7.3.7)\n\n* 7.3.8. [regex](#rfc.section.7.3.8)\n\n\n\n* 8\\. [String-Encoding Non-JSON Data](#rfc.section.8)\n\n\n\n* 8.1. [Foreword](#rfc.section.8.1)\n\n* 8.2. [Implementation Requirements](#rfc.section.8.2)\n\n* 8.3. [contentEncoding](#rfc.section.8.3)\n\n* 8.4. [contentMediaType](#rfc.section.8.4)\n\n* 8.5. [Example](#rfc.section.8.5)\n\n\n\n* 9\\. [Schema Re-Use With "definitions"](#rfc.section.9)\n\n* 10\\. [Schema Annotations](#rfc.section.10)\n\n\n\n* 10.1. ["title" and "description"](#rfc.section.10.1)\n\n* 10.2. ["default"](#rfc.section.10.2)\n\n* 10.3. ["readOnly" and "writeOnly"](#rfc.section.10.3)\n\n* 10.4. ["examples"](#rfc.section.10.4)\n\n\n\n* 11\\. [Security Considerations](#rfc.section.11)\n\n* 12\\. [References](#rfc.references)\n\n\n\n* 12.1. [Normative References](#rfc.references.1)\n\n* 12.2. [Informative References](#rfc.references.2)\n\n\n\n* Appendix A. [Acknowledgments](#rfc.appendix.A)\n\n* Appendix B. [ChangeLog](#rfc.appendix.B)\n\n* [Authors\' Addresses](#rfc.authors)\n\n\n\n[1.](#rfc.section.1) Introduction\n\n=================================\n\n\n\nJSON Schema can be used to require that a given JSON document (an instance) satisfies a certain number of criteria. These criteria are asserted by using keywords described in this specification. In addition, a set of keywords is also defined to assist in interactive user interface instance generation.\n\n\n\nThis specification will use the concepts, syntax, and terminology defined by the [JSON Schema core](#json-schema) \\[json-schema\\] specification.\n\n\n\n[2.](#rfc.section.2) Conventions and Terminology\n\n================================================\n\n\n\nThe key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](#RFC2119) \\[RFC2119\\].\n\n\n\nThis specification uses the term "container instance" to refer to both array and object instances. It uses the term "children instances" to refer to array elements or object member values.\n\n\n\nElements in an array value are said to be unique if no two elements of this array are [equal](#json-schema) \\[json-schema\\].\n\n\n\n[3.](#rfc.section.3) Overview\n\n=============================\n\n\n\nJSON Schema validation applies schemas to locations within the instance, and asserts constraints on the structure of the data at each location. An instance location that satisfies all asserted constraints is then annotated with any keywords that contain non-assertion information, such as descriptive metadata and usage hints. If all locations within the instance satisfy all asserted constraints, then the instance is said to be valid against the schema.\n\n\n\nEach schema object is independently evaluated against each instance location to which it applies. This greatly simplifies the implementation requirements for validators by ensuring that they do not need to maintain state across the document-wide validation process.\n\n\n\n[3.1.](#rfc.section.3.1) Applicability\n\n======================================\n\n\n\nValidation begins by applying the root schema to the complete instance document. From there, various keywords are used to determine which additional subschemas are applied to either the current location, or a child location. These keywords also define whether and how subschema assertion results are modified and/or combined. Such keywords do not assert conditions on their own. Rather, they control how assertions are applied and evaluated.\n\n\n\nThe keywords in the [boolean logic](#logic) \\[logic\\] and [conditional](#conditional) \\[conditional\\] sections of this specification apply subschemas to the same location as the parent schema. The former group defines boolean operations on the subschema assertion results, while the latter evaluates one subschema and uses its assertion results to determine which of two other subschemas to apply as well.\n\n\n\nSeveral keywords determine which subschemas are applied to array items, object property values, and object property names. They are: "items", "additionalItems", "contains", "properties", "patternProperties", "additionalProperties", and "propertyNames". The "contains" keyword only requires its subschema to be valid against at least one child instance, while the other keywords require that all subschemas are valid against all child instances to which they apply.\n\n\n\n[3.1.1.](#rfc.section.3.1.1) Keyword Independence\n\n=================================================\n\n\n\nValidation keywords typically operate independently, without affecting each other\'s outcomes.\n\n\n\nFor schema author convenience, there are some exceptions among the keywords that control subschema applicability:\n\n\n\n* "additionalProperties", whose behavior is defined in terms of "properties" and "patternProperties"; and\n\n* "additionalItems", whose behavior is defined in terms of "items".\n\n\n\n[3.2.](#rfc.section.3.2) [Assertions](#assertions)\n\n==================================================\n\n\n\nValidation is a process of checking assertions. Each assertion adds constraints that an instance must satisfy in order to successfully validate.\n\n\n\nAssertion keywords that are absent never restrict validation. In some cases, this no-op behavior is identical to a keyword that exists with certain values, and these values are noted where known.\n\n\n\nAll of the keywords in the [general](#general) \\[general\\], [numeric](#numeric) \\[numeric\\], and [string](#string) \\[string\\] sections are assertions, as well as "minItems", "maxItems", "uniqueItems", "minProperties", "maxProperties", and "required". Additionally, "dependencies" is shorthand for a combination of conditional and assertion keywords.\n\n\n\nThe "format", "contentType", and "contentEncoding" keywords can also be implemented as assertions, although that functionality is an optional part of this specification, and the keywords convey additional non-assertion information.\n\n\n\n[3.2.1.](#rfc.section.3.2.1) Assertions and Instance Primitive Types\n\n====================================================================\n\n\n\nMost validation assertions only constrain values within a certain primitive type. When the type of the instance is not of the type targeted by the keyword, the instance is considered to conform to the assertion.\n\n\n\nFor example, the "maxLength" keyword will only restrict certain strings (that are too long) from being valid. If the instance is a number, boolean, null, array, or object, then it is valid against this assertion.\n\n\n\n[3.3.](#rfc.section.3.3) [Annotations](#annotations)\n\n====================================================\n\n\n\nIn addition to assertions, this specification provides a small vocabulary of metadata keywords that can be used to annotate the JSON instance with useful information. The [Section 7](#format) and [Section 8](#content) keywords are also useful as annotations as well as being optional assertions, as they convey additional usage guidance for the instance data.\n\n\n\nA schema that is applicable to a particular location in the instance, against which the instance location is valid, attaches its annotations to that location in the instance. Since many subschemas can be applicable to any single location, annotation keywords need to specify any unusual handling of multiple applicable occurrences of the keyword with different values. The default behavior is simply to collect all values.\n\n\n\nAdditional vocabularies SHOULD make use of this mechanism for applying their own annotations to instances.\n\n\n\n[3.3.1.](#rfc.section.3.3.1) Annotations and Validation Outcomes\n\n================================================================\n\n\n\nAnnotations are collected whenever an instance is valid against a schema object, and all of that schema object\'s parent schemas.\n\n\n\nIn particular, annotations in a subschema contained within a "not", at any depth, including any number of intervening additional "not" subschemas, MUST be ignored. If the instance was valid against the "not" subschema, then by definition it is not valid against the schema that contains the "not", so the "not" subschema\'s annotations are not used.\n\n\n\nSimilarly, annotations within a failing branch of a "oneOf", "anyOf", "then", or "else" MUST be ignored even when the instance successfully validates against the complete schema document.\n\n\n\n[3.3.2.](#rfc.section.3.3.2) Annotations and Short-Circuit Validation\n\n=====================================================================\n\n\n\nAnnotation keywords MUST be applied to all possible sub-instances. Even if such application can be short-circuited when only assertion evaluation is needed. For instance, the "contains" keyword need only be checked for assertions until at least one array item proves valid. However, when working with annotations, all items in the array must be evaluated to determine all items with which the annotations should be associated.\n\n\n\n[4.](#rfc.section.4) Interoperability Considerations\n\n====================================================\n\n\n\n[4.1.](#rfc.section.4.1) Validation of String Instances\n\n=======================================================\n\n\n\nIt should be noted that the nul character (\\\u0000) is valid in a JSON string. An instance to validate may contain a string value with this character, regardless of the ability of the underlying programming language to deal with such data.\n\n\n\n[4.2.](#rfc.section.4.2) Validation of Numeric Instances\n\n========================================================\n\n\n\nThe JSON specification allows numbers with arbitrary precision, and JSON Schema does not add any such bounds. This means that numeric instances processed by JSON Schema can be arbitrarily large and/or have an arbitrarily long decimal part, regardless of the ability of the underlying programming language to deal with such data.\n\n\n\n[4.3.](#rfc.section.4.3) [Regular Expressions](#regexInterop)\n\n=============================================================\n\n\n\nTwo validation keywords, "pattern" and "patternProperties", use regular expressions to express constraints, and the "regex" value for the "format" keyword constrains the instance value to be a regular expression. These regular expressions SHOULD be valid according to the [ECMA 262](#ecma262) \\[ecma262\\] regular expression dialect.\n\n\n\nFurthermore, given the high disparity in regular expression constructs support, schema authors SHOULD limit themselves to the following regular expression tokens:\n\n\n\n* individual Unicode characters, as defined by the [JSON specification](#RFC7159) \\[RFC7159\\];\n\n* simple character classes (\\[abc\\]), range character classes (\\[a-z\\]);\n\n* complemented character classes (\\[^abc\\], \\[^a-z\\]);\n\n* simple quantifiers: "+" (one or more), "\\*" (zero or more), "?" (zero or one), and their lazy versions ("+?", "\\*?", "??");\n\n* range quantifiers: "{x}" (exactly x occurrences), "{x,y}" (at least x, at most y, occurrences), {x,} (x occurrences or more), and their lazy versions;\n\n* the beginning-of-input ("^") and end-of-input ("$") anchors;\n\n* simple grouping ("(...)") and alternation ("|").\n\n\n\nFinally, implementations MUST NOT take regular expressions to be anchored, neither at the beginning nor at the end. This means, for instance, the pattern "es" matches "expression".\n\n\n\n[5.](#rfc.section.5) Meta-Schema\n\n================================\n\n\n\nThe current URI for the JSON Schema Validation is <[http://json-schema.org/draft-07/schema#](http://json-schema.org/draft-07/schema#)\\>.\n\n\n\n[6.](#rfc.section.6) Validation Keywords\n\n========================================\n\n\n\nValidation keywords in a schema impose requirements for successful validation of an instance.\n\n\n\n[6.1.](#rfc.section.6.1) [Validation Keywords for Any Instance Type](#general)\n\n==============================================================================\n\n\n\n[6.1.1.](#rfc.section.6.1.1) type\n\n=================================\n\n\n\nThe value of this keyword MUST be either a string or an array. If it is an array, elements of the array MUST be strings and MUST be unique.\n\n\n\nString values MUST be one of the six primitive types ("null", "boolean", "object", "array", "number", or "string"), or "integer" which matches any number with a zero fractional part.\n\n\n\nAn instance validates if and only if the instance is in any of the sets listed for this keyword.\n\n\n\n[6.1.2.](#rfc.section.6.1.2) enum\n\n=================================\n\n\n\nThe value of this keyword MUST be an array. This array SHOULD have at least one element. Elements in the array SHOULD be unique.\n\n\n\nAn instance validates successfully against this keyword if its value is equal to one of the elements in this keyword\'s array value.\n\n\n\nElements in the array might be of any value, including null.\n\n\n\n[6.1.3.](#rfc.section.6.1.3) const\n\n==================================\n\n\n\nThe value of this keyword MAY be of any type, including null.\n\n\n\nAn instance validates successfully against this keyword if its value is equal to the value of the keyword.\n\n\n\n[6.2.](#rfc.section.6.2) [Validation Keywords for Numeric Instances (number and integer)](#numeric)\n\n===================================================================================================\n\n\n\n[6.2.1.](#rfc.section.6.2.1) multipleOf\n\n=======================================\n\n\n\nThe value of "multipleOf" MUST be a number, strictly greater than 0.\n\n\n\nA numeric instance is valid only if division by this keyword\'s value results in an integer.\n\n\n\n[6.2.2.](#rfc.section.6.2.2) maximum\n\n====================================\n\n\n\nThe value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance.\n\n\n\nIf the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".\n\n\n\n[6.2.3.](#rfc.section.6.2.3) exclusiveMaximum\n\n=============================================\n\n\n\nThe value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance.\n\n\n\nIf the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".\n\n\n\n[6.2.4.](#rfc.section.6.2.4) minimum\n\n====================================\n\n\n\nThe value of "minimum" MUST be a number, representing an inclusive lower limit for a numeric instance.\n\n\n\nIf the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".\n\n\n\n[6.2.5.](#rfc.section.6.2.5) exclusiveMinimum\n\n=============================================\n\n\n\nThe value of "exclusiveMinimum" MUST be number, representing an exclusive lower limit for a numeric instance.\n\n\n\nIf the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".\n\n\n\n[6.3.](#rfc.section.6.3) [Validation Keywords for Strings](#string)\n\n===================================================================\n\n\n\n[6.3.1.](#rfc.section.6.3.1) maxLength\n\n======================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nA string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.\n\n\n\nThe length of a string instance is defined as the number of its characters as defined by [RFC 7159](#RFC7159) \\[RFC7159\\].\n\n\n\n[6.3.2.](#rfc.section.6.3.2) minLength\n\n======================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nA string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.\n\n\n\nThe length of a string instance is defined as the number of its characters as defined by [RFC 7159](#RFC7159) \\[RFC7159\\].\n\n\n\nOmitting this keyword has the same behavior as a value of 0.\n\n\n\n[6.3.3.](#rfc.section.6.3.3) pattern\n\n====================================\n\n\n\nThe value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect.\n\n\n\nA string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.\n\n\n\n[6.4.](#rfc.section.6.4) Validation Keywords for Arrays\n\n=======================================================\n\n\n\n[6.4.1.](#rfc.section.6.4.1) items\n\n==================================\n\n\n\nThe value of "items" MUST be either a valid JSON Schema or an array of valid JSON Schemas.\n\n\n\nThis keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.\n\n\n\nIf "items" is a schema, validation succeeds if all elements in the array successfully validate against that schema.\n\n\n\nIf "items" is an array of schemas, validation succeeds if each element of the instance validates against the schema at the same position, if any.\n\n\n\nOmitting this keyword has the same behavior as an empty schema.\n\n\n\n[6.4.2.](#rfc.section.6.4.2) additionalItems\n\n============================================\n\n\n\nThe value of "additionalItems" MUST be a valid JSON Schema.\n\n\n\nThis keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.\n\n\n\nIf "items" is an array of schemas, validation succeeds if every instance element at a position greater than the size of "items" validates against "additionalItems".\n\n\n\nOtherwise, "additionalItems" MUST be ignored, as the "items" schema (possibly the default value of an empty schema) is applied to all elements.\n\n\n\nOmitting this keyword has the same behavior as an empty schema.\n\n\n\n[6.4.3.](#rfc.section.6.4.3) maxItems\n\n=====================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nAn array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.\n\n\n\n[6.4.4.](#rfc.section.6.4.4) minItems\n\n=====================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nAn array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.\n\n\n\nOmitting this keyword has the same behavior as a value of 0.\n\n\n\n[6.4.5.](#rfc.section.6.4.5) uniqueItems\n\n========================================\n\n\n\nThe value of this keyword MUST be a boolean.\n\n\n\nIf this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.\n\n\n\nOmitting this keyword has the same behavior as a value of false.\n\n\n\n[6.4.6.](#rfc.section.6.4.6) contains\n\n=====================================\n\n\n\nThe value of this keyword MUST be a valid JSON Schema.\n\n\n\nAn array instance is valid against "contains" if at least one of its elements is valid against the given schema.\n\n\n\n[6.5.](#rfc.section.6.5) Validation Keywords for Objects\n\n========================================================\n\n\n\n[6.5.1.](#rfc.section.6.5.1) maxProperties\n\n==========================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nAn object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.\n\n\n\n[6.5.2.](#rfc.section.6.5.2) minProperties\n\n==========================================\n\n\n\nThe value of this keyword MUST be a non-negative integer.\n\n\n\nAn object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword.\n\n\n\nOmitting this keyword has the same behavior as a value of 0.\n\n\n\n[6.5.3.](#rfc.section.6.5.3) required\n\n=====================================\n\n\n\nThe value of this keyword MUST be an array. Elements of this array, if any, MUST be strings, and MUST be unique.\n\n\n\nAn object instance is valid against this keyword if every item in the array is the name of a property in the instance.\n\n\n\nOmitting this keyword has the same behavior as an empty array.\n\n\n\n[6.5.4.](#rfc.section.6.5.4) properties\n\n=======================================\n\n\n\nThe value of "properties" MUST be an object. Each value of this object MUST be a valid JSON Schema.\n\n\n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n\n\nValidation 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.\n\n\n\nOmitting this keyword has the same behavior as an empty object.\n\n\n\n[6.5.5.](#rfc.section.6.5.5) patternProperties\n\n==============================================\n\n\n\nThe value of "patternProperties" MUST be an object. Each property name of this object SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. Each property value of this object MUST be a valid JSON Schema.\n\n\n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. Validation of the primitive instance type against this keyword always succeeds.\n\n\n\nValidation 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.\n\n\n\nOmitting this keyword has the same behavior as an empty object.\n\n\n\n[6.5.6.](#rfc.section.6.5.6) additionalProperties\n\n=================================================\n\n\n\nThe value of "additionalProperties" MUST be a valid JSON Schema.\n\n\n\nThis keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.\n\n\n\nValidation with "additionalProperties" applies only to the child values of instance names that do not match any names in "properties", and do not match any regular expression in "patternProperties".\n\n\n\nFor all such properties, validation succeeds if the child instance validates against the "additionalProperties" schema.\n\n\n\nOmitting this keyword has the same behavior as an empty schema.\n\n\n\n[6.5.7.](#rfc.section.6.5.7) dependencies\n\n=========================================\n\n\n\n\\[CREF1\\]This keyword may be split into two, with the variation that uses an array of property names rather than a subschema getting a new name. The dual behavior is confusing and relatively difficult to implement. In the previous draft, we proposed dropping the keyword altogether, or dropping one of its forms, but we received feedback in support of keeping it. See issues #442 and #528 at for further discussion. Further feedback is encouraged.\n\n\n\nThis keyword specifies rules that are evaluated if the instance is an object and contains a certain property.\n\n\n\nThis keyword\'s value MUST be an object. Each property specifies a dependency. Each dependency value MUST be an array or a valid JSON Schema.\n\n\n\nIf the dependency value is a subschema, and the dependency key is a property in the instance, the entire instance must validate against the dependency value.\n\n\n\nIf the dependency value is an array, each element in the array, if any, MUST be a string, and MUST be unique. If the dependency key is a property in the instance, each of the items in the dependency value must be a property that exists in the instance.\n\n\n\nOmitting this keyword has the same behavior as an empty object.\n\n\n\n[6.5.8.](#rfc.section.6.5.8) propertyNames\n\n==========================================\n\n\n\nThe value of "propertyNames" MUST be a valid JSON Schema.\n\n\n\nIf the instance is an object, this keyword validates if every property name in the instance validates against the provided schema. Note the property name that the schema is testing will always be a string.\n\n\n\nOmitting this keyword has the same behavior as an empty schema.\n\n\n\n[6.6.](#rfc.section.6.6) [Keywords for Applying Subschemas Conditionally](#conditional)\n\n=======================================================================================\n\n\n\nThese keywords work together to implement conditional application of a subschema based on the outcome of another subschema.\n\n\n\nThese keywords MUST NOT interact with each other across subschema boundaries. In other words, an "if" in one branch of an "allOf" MUST NOT have an impact on a "then" or "else" in another branch.\n\n\n\nThere is no default behavior for any of these keywords when they are not present. In particular, they MUST NOT be treated as if present with an empty schema, and when "if" is not present, both "then" and "else" MUST be entirely ignored.\n\n\n\n[6.6.1.](#rfc.section.6.6.1) if\n\n===============================\n\n\n\nThis keyword\'s value MUST be a valid JSON Schema.\n\n\n\nThis validation outcome of this keyword\'s subschema has no direct effect on the overall validation result. Rather, it controls which of the "then" or "else" keywords are evaluated.\n\n\n\nInstances that successfully validate against this keyword\'s subschema MUST also be valid against the subschema value of the "then" keyword, if present.\n\n\n\nInstances that fail to validate against this keyword\'s subschema MUST also be valid against the subschema value of the "else" keyword, if present.\n\n\n\nIf [annotations](#annotations) \\[annotations\\] are being collected, they are collected from this keyword\'s subschema in the usual way, including when the keyword is present without either "then" or "else".\n\n\n\n[6.6.2.](#rfc.section.6.6.2) then\n\n=================================\n\n\n\nThis keyword\'s value MUST be a valid JSON Schema.\n\n\n\nWhen "if" is present, and the instance successfully validates against its subschema, then valiation succeeds against this keyword if the instance also successfully validates against this keyword\'s subschema.\n\n\n\nThis keyword has no effect when "if" is absent, or when the instance fails to validate against its subschema. Implementations MUST NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.\n\n\n\n[6.6.3.](#rfc.section.6.6.3) else\n\n=================================\n\n\n\nThis keyword\'s value MUST be a valid JSON Schema.\n\n\n\nWhen "if" is present, and the instance fails to validate against its subschema, then valiation succeeds against this keyword if the instance successfully validates against this keyword\'s subschema.\n\n\n\nThis keyword has no effect when "if" is absent, or when the instance successfully validates against its subschema. Implementations MUST NOT evaluate the instance against this keyword, for either validation or annotation collection purposes, in such cases.\n\n\n\n[6.7.](#rfc.section.6.7) [Keywords for Applying Subschemas With Boolean Logic](#logic)\n\n======================================================================================\n\n\n\n[6.7.1.](#rfc.section.6.7.1) allOf\n\n==================================\n\n\n\nThis keyword\'s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.\n\n\n\nAn instance validates successfully against this keyword if it validates successfully against all schemas defined by this keyword\'s value.\n\n\n\n[6.7.2.](#rfc.section.6.7.2) anyOf\n\n==================================\n\n\n\nThis keyword\'s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.\n\n\n\nAn instance validates successfully against this keyword if it validates successfully against at least one schema defined by this keyword\'s value.\n\n\n\n[6.7.3.](#rfc.section.6.7.3) oneOf\n\n==================================\n\n\n\nThis keyword\'s value MUST be a non-empty array. Each item of the array MUST be a valid JSON Schema.\n\n\n\nAn instance validates successfully against this keyword if it validates successfully against exactly one schema defined by this keyword\'s value.\n\n\n\n[6.7.4.](#rfc.section.6.7.4) not\n\n================================\n\n\n\nThis keyword\'s value MUST be a valid JSON Schema.\n\n\n\nAn instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.\n\n\n\n[7.](#rfc.section.7) [Semantic Validation With "format"](#format)\n\n=================================================================\n\n\n\n[7.1.](#rfc.section.7.1) Foreword\n\n=================================\n\n\n\nStructural validation alone may be insufficient to validate that an instance meets all the requirements of an application. The "format" keyword is defined to allow interoperable semantic validation for a fixed subset of values which are accurately described by authoritative resources, be they RFCs or other external specifications.\n\n\n\nThe value of this keyword is called a format attribute. It MUST be a string. A format attribute can generally only validate a given set of instance types. If the type of the instance to validate is not in this set, validation for this format attribute and instance SHOULD succeed.\n\n\n\n[7.2.](#rfc.section.7.2) Implementation Requirements\n\n====================================================\n\n\n\nThe "format" keyword functions as both an annotation ([Section 3.3](#annotations)) and as an assertion ([Section 3.2](#assertions)). While no special effort is required to implement it as an annotation conveying semantic meaning, implementing validation is non-trivial.\n\n\n\nImplementations MAY support the "format" keyword as a validation assertion. Should they choose to do so:\n\n\n\n* they SHOULD implement validation for attributes defined below;\n\n* they SHOULD offer an option to disable validation for this keyword.\n\n\n\nImplementations MAY add custom format attributes. Save for agreement between parties, schema authors SHALL NOT expect a peer implementation to support this keyword and/or custom format attributes.\n\n\n\n[7.3.](#rfc.section.7.3) Defined Formats\n\n========================================\n\n\n\n[7.3.1.](#rfc.section.7.3.1) Dates and Times\n\n============================================\n\n\n\nThese attributes apply to string instances.\n\n\n\nDate and time format names are derived from [RFC 3339, section 5.6](#RFC3339) \\[RFC3339\\].\n\n\n\nImplementations supporting formats SHOULD implement support for the following attributes:\n\n\n\ndate-time:\n\n\n\nA string instance is valid against this attribute if it is a valid representation according to the "date-time" production.\n\n\n\ndate:\n\n\n\nA string instance is valid against this attribute if it is a valid representation according to the "full-date" production.\n\n\n\ntime:\n\n\n\nA string instance is valid against this attribute if it is a valid representation according to the "full-time" production.\n\n\n\nImplementations MAY support additional attributes using the other production names defined in that section. If "full-date" or "full-time" are implemented, the corresponding short form ("date" or "time" respectively) MUST be implemented, and MUST behave identically. Implementations SHOULD NOT define extension attributes with any name matching an RFC 3339 production unless it validates according to the rules of that production. \\[CREF2\\]There is not currently consensus on the need for supporting all RFC 3339 formats, so this approach of reserving the namespace will encourage experimentation without committing to the entire set. Either the format implementation requirements will become more flexible in general, or these will likely either be promoted to fully specified attributes or dropped.\n\n\n\n[7.3.2.](#rfc.section.7.3.2) Email Addresses\n\n============================================\n\n\n\nThese attributes apply to string instances.\n\n\n\nA string instance is valid against these attributes if it is a valid Internet email address as follows:\n\n\n\nemail:\n\n\n\nAs defined by [RFC 5322, section 3.4.1](#RFC5322) \\[RFC5322\\].\n\n\n\nidn-email:\n\n\n\nAs defined by [RFC 6531](#RFC6531) \\[RFC6531\\]\n\n\n\nNote that all strings valid against the "email" attribute are also valid against the "idn-email" attribute.\n\n\n\n[7.3.3.](#rfc.section.7.3.3) Hostnames\n\n======================================\n\n\n\nThese attributes apply to string instances.\n\n\n\nA string instance is valid against these attributes if it is a valid representation for an Internet hostname as follows:\n\n\n\nhostname:\n\n\n\nAs defined by [RFC 1034, section 3.1](#RFC1034) \\[RFC1034\\], including host names produced using the Punycode algorithm specified in [RFC 5891, section 4.4](#RFC5891) \\[RFC5891\\].\n\n\n\nidn-hostname:\n\n\n\nAs defined by either RFC 1034 as for hostname, or an internationalized hostname as defined by [RFC 5890, section 2.3.2.3](#RFC5890) \\[RFC5890\\].\n\n\n\nNote that all strings valid against the "hostname" attribute are also valid against the "idn-hostname" attribute.\n\n\n\n[7.3.4.](#rfc.section.7.3.4) IP Addresses\n\n=========================================\n\n\n\nThese attributes apply to string instances.\n\n\n\nA string instance is valid against these attributes if it is a valid representation of an IP address as follows:\n\n\n\nipv4:\n\n\n\nAn IPv4 address according to the "dotted-quad" ABNF syntax as defined in [RFC 2673, section 3.2](#RFC2673) \\[RFC2673\\].\n\n\n\nipv6:\n\n\n\nAn IPv6 address as defined in [RFC 4291, section 2.2](#RFC4291) \\[RFC4291\\].\n\n\n\n[7.3.5.](#rfc.section.7.3.5) Resource Identifiers\n\n=================================================\n\n\n\nThese attributes apply to string instances.\n\n\n\nuri:\n\n\n\nA string instance is valid against this attribute if it is a valid URI, according to [\\[RFC3986\\]](#RFC3986).\n\n\n\nuri-reference:\n\n\n\nA string instance is valid against this attribute if it is a valid URI Reference (either a URI or a relative-reference), according to [\\[RFC3986\\]](#RFC3986).\n\n\n\niri:\n\n\n\nA string instance is valid against this attribute if it is a valid IRI, according to [\\[RFC3987\\]](#RFC3987).\n\n\n\niri-reference:\n\n\n\nA string instance is valid against this attribute if it is a valid IRI Reference (either an IRI or a relative-reference), according to [\\[RFC3987\\]](#RFC3987).\n\n\n\nNote that all valid URIs are valid IRIs, and all valid URI References are also valid IRI References.\n\n\n\n[7.3.6.](#rfc.section.7.3.6) uri-template\n\n=========================================\n\n\n\nThis attribute applies to string instances.\n\n\n\nA string instance is valid against this attribute if it is a valid URI Template (of any level), according to [\\[RFC6570\\]](#RFC6570).\n\n\n\nNote that URI Templates may be used for IRIs; there is no separate IRI Template specification.\n\n\n\n[7.3.7.](#rfc.section.7.3.7) JSON Pointers\n\n==========================================\n\n\n\nThese attributes apply to string instances.\n\n\n\njson-pointer:\n\n\n\nA string instance is valid against this attribute if it is a valid JSON string representation of a JSON Pointer, according to [RFC 6901, section 5](#RFC6901) \\[RFC6901\\].\n\n\n\nrelative-json-pointer:\n\n\n\nA string instance is valid against this attribute if it is a valid [Relative JSON Pointer](#relative-json-pointer) \\[relative-json-pointer\\].\n\n\n\nTo allow for both absolute and relative JSON Pointers, use "anyOf" or "oneOf" to indicate support for either format.\n\n\n\n[7.3.8.](#rfc.section.7.3.8) regex\n\n==================================\n\n\n\nThis attribute applies to string instances.\n\n\n\nA regular expression, which SHOULD be valid according to the [ECMA 262](#ecma262) \\[ecma262\\] regular expression dialect.\n\n\n\nImplementations that validate formats MUST accept at least the subset of ECMA 262 defined in the [Regular Expressions](#regexInterop) \\[regexInterop\\] section of this specification, and SHOULD accept all valid ECMA 262 expressions.\n\n\n\n[8.](#rfc.section.8) [String-Encoding Non-JSON Data](#content)\n\n==============================================================\n\n\n\n[8.1.](#rfc.section.8.1) Foreword\n\n=================================\n\n\n\nProperties defined in this section indicate that an instance contains non-JSON data encoded in a JSON string. They describe the type of content and how it is encoded.\n\n\n\nThese properties provide additional information required to interpret JSON data as rich multimedia documents.\n\n\n\n[8.2.](#rfc.section.8.2) Implementation Requirements\n\n====================================================\n\n\n\nThe content keywords function as both annotations ([Section 3.3](#annotations)) and as assertions ([Section 3.2](#assertions)). While no special effort is required to implement them as annotations conveying how applications can interpret the data in the string, implementing validation of conformance to the media type and encoding is non-trivial.\n\n\n\nImplementations MAY support the "contentMediaType" and "contentEncoding" keywords as validation assertions. Should they choose to do so, they SHOULD offer an option to disable validation for these keywords.\n\n\n\n[8.3.](#rfc.section.8.3) contentEncoding\n\n========================================\n\n\n\nIf the instance value is a string, this property defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this property. [RFC 2045, Sec 6.1](#RFC2045) \\[RFC2045\\] lists the possible values for this property.\n\n\n\nThe value of this property MUST be a string.\n\n\n\nThe value of this property SHOULD be ignored if the instance described is not a string.\n\n\n\n[8.4.](#rfc.section.8.4) contentMediaType\n\n=========================================\n\n\n\nThe value of this property must be a media type, as defined by [RFC 2046](#RFC2046) \\[RFC2046\\]. This property defines the media type of instances which this schema defines.\n\n\n\nThe value of this property MUST be a string.\n\n\n\nThe value of this property SHOULD be ignored if the instance described is not a string.\n\n\n\nIf the "contentEncoding" property is not present, but the instance value is a string, then the value of this property SHOULD specify a text document type, and the character set SHOULD be the character set into which the JSON string value was decoded (for which the default is Unicode).\n\n\n\n[8.5.](#rfc.section.8.5) Example\n\n================================\n\n\n\nHere is an example schema, illustrating the use of "contentEncoding" and "contentMediaType":\n\n\n\n{\n\n "type": "string",\n\n "contentEncoding": "base64",\n\n "contentMediaType": "image/png"\n\n}\n\n\n\n\n\n\n\nInstances described by this schema should be strings, and their values should be interpretable as base64-encoded PNG images.\n\n\n\nAnother example:\n\n\n\n{\n\n "type": "string",\n\n "contentMediaType": "text/html"\n\n}\n\n\n\n\n\n\n\nInstances described by this schema should be strings containing HTML, using whatever character set the JSON string was decoded into (default is Unicode).\n\n\n\n[9.](#rfc.section.9) Schema Re-Use With "definitions"\n\n=====================================================\n\n\n\nThe "definitions" keywords provides a standardized location for schema authors to inline re-usable JSON Schemas into a more general schema. The keyword does not directly affect the validation result.\n\n\n\nThis keyword\'s value MUST be an object. Each member value of this object MUST be a valid JSON Schema.\n\n\n\n{\n\n "type": "array",\n\n "items": { "$ref": "#/definitions/positiveInteger" },\n\n "definitions": {\n\n "positiveInteger": {\n\n "type": "integer",\n\n "exclusiveMinimum": 0\n\n }\n\n }\n\n}\n\n\n\n\n\n\n\nAs an example, here is a schema describing an array of positive integers, where the positive integer constraint is a subschema in "definitions":\n\n\n\n[10.](#rfc.section.10) Schema Annotations\n\n=========================================\n\n\n\nSchema validation is a useful mechanism for annotating instance data with additional information. The rules for determining when and how annotations are associated with an instance are outlined in section [3.3](#annotations).\n\n\n\nThese general-purpose annotation keywords provide commonly used information for documentation and user interface display purposes. They are not intended to form a comprehensive set of features. Rather, additional vocabularies can be defined for more complex annotation-based applications.\n\n\n\n[10.1.](#rfc.section.10.1) "title" and "description"\n\n====================================================\n\n\n\nThe value of both of these keywords MUST be a string.\n\n\n\nBoth of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.\n\n\n\n[10.2.](#rfc.section.10.2) "default"\n\n====================================\n\n\n\nThere are no restrictions placed on the value of this keyword. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations SHOULD remove duplicates.\n\n\n\nThis keyword can be used to supply a default JSON value associated with a particular schema. It is RECOMMENDED that a default value be valid against the associated schema.\n\n\n\n[10.3.](#rfc.section.10.3) "readOnly" and "writeOnly"\n\n=====================================================\n\n\n\nThe value of these keywords MUST be a boolean. When multiple occurrences of these keywords are applicable to a single sub-instance, the resulting value MUST be true if any occurrence specifies a true value, and MUST be false otherwise.\n\n\n\nIf "readOnly" has a value of boolean true, it 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.\n\n\n\nAn instance document that is marked as "readOnly for the entire document MAY be ignored if sent to the owning authority, or MAY result in an error, at the authority\'s discretion.\n\n\n\nIf "writeOnly" has a value of boolean true, it indicates that the value is never present when the instance is retrieved from the owning authority. It can be present when sent to the owning authority to update or create the document (or the resource it represents), but it will not be included in any updated or newly created version of the instance.\n\n\n\nAn instance document that is marked as "writeOnly" for the entire document MAY be returned as a blank document of some sort, or MAY produce an error upon retrieval, or have the retrieval request ignored, at the authority\'s discretion.\n\n\n\nFor example, "readOnly" would be used to mark a database-generated serial number as read-only, while "writeOnly" would be used to mark a password input field.\n\n\n\nThese keywords can be used to assist in user interface instance generation. In particular, an application MAY choose to use a widget that hides input values as they are typed for write-only fields.\n\n\n\nOmitting these keywords has the same behavior as values of false.\n\n\n\n[10.4.](#rfc.section.10.4) "examples"\n\n=====================================\n\n\n\nThe value of this keyword MUST be an array. There are no restrictions placed on the values within the array. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations MUST provide a flat array of all values rather than an array of arrays.\n\n\n\nThis keyword can be used to provide sample JSON values associated with a particular schema, for the purpose of illustrating usage. It is RECOMMENDED that these values be valid against the associated schema.\n\n\n\nImplementations MAY use the value(s) of "default", if present, as an additional example. If "examples" is absent, "default" MAY still be used in this manner.\n\n\n\n[11.](#rfc.section.11) Security Considerations\n\n==============================================\n\n\n\nJSON Schema validation defines a vocabulary for JSON Schema core and concerns all the security considerations listed there.\n\n\n\nJSON Schema validation allows the use of Regular Expressions, which have numerous different (often incompatible) implementations. Some implementations allow the embedding of arbitrary code, which is outside the scope of JSON Schema and MUST NOT be permitted. Regular expressions can often also be crafted to be extremely expensive to compute (with so-called "catastrophic backtracking"), resulting in a denial-of-service attack.\n\n\n\nImplementations that support validating or otherwise evaluating instance string data based on "contentEncoding" and/or "contentMediaType" are at risk of evaluating data in an unsafe way based on misleading information. Applications can mitigate this risk by only performing such processing when a relationship between the schema and instance is established (e.g., they share the same authority).\n\n\n\nProcessing a media type or encoding is subject to the security considerations of that media type or encoding. For example, the security considerations of [RFC 4329 Scripting Media Types](#RFC4329) \\[RFC4329\\] apply when processing JavaScript or ECMAScript encoded within a JSON string.\n\n\n\n[12.](#rfc.references) References\n\n=================================\n\n\n\n[12.1.](#rfc.references.1) Normative References\n\n===============================================\n\n\n\n, "\n\n\n\n**\\[RFC2119\\]**\n\n\n\nBradner, S., "[Key words for use in RFCs to Indicate Requirement Levels](http://tools.ietf.org/html/rfc2119)", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.\n\n\n\n**\\[RFC1034\\]**\n\n\n\nMockapetris, P., "[Domain names - concepts and facilities](http://tools.ietf.org/html/rfc1034)", STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987.\n\n\n\n**\\[RFC2045\\]**\n\n\n\nFreed, N. and N. Borenstein, "[Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies](http://tools.ietf.org/html/rfc2045)", RFC 2045, DOI 10.17487/RFC2045, November 1996.\n\n\n\n**\\[RFC2046\\]**\n\n\n\nFreed, N. and N. Borenstein, "[Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types](http://tools.ietf.org/html/rfc2046)", RFC 2046, DOI 10.17487/RFC2046, November 1996.\n\n\n\n**\\[RFC2673\\]**\n\n\n\nCrawford, M., "[Binary Labels in the Domain Name System](http://tools.ietf.org/html/rfc2673)", RFC 2673, DOI 10.17487/RFC2673, August 1999.\n\n\n\n**\\[RFC3339\\]**\n\n\n\nKlyne, G. and C. Newman, "[Date and Time on the Internet: Timestamps](http://tools.ietf.org/html/rfc3339)", RFC 3339, DOI 10.17487/RFC3339, July 2002.\n\n\n\n**\\[RFC3986\\]**\n\n\n\nBerners-Lee, T., Fielding, R. and L. Masinter, "[Uniform Resource Identifier (URI): Generic Syntax](http://tools.ietf.org/html/rfc3986)", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005.\n\n\n\n**\\[RFC3987\\]**\n\n\n\nDuerst, M. and M. Suignard, "[Internationalized Resource Identifiers (IRIs)](http://tools.ietf.org/html/rfc3987)", RFC 3987, DOI 10.17487/RFC3987, January 2005.\n\n\n\n**\\[RFC4291\\]**\n\n\n\nHinden, R. and S. Deering, "[IP Version 6 Addressing Architecture](http://tools.ietf.org/html/rfc4291)", RFC 4291, DOI 10.17487/RFC4291, February 2006.\n\n\n\n**\\[RFC5322\\]**\n\n\n\nResnick, P., "[Internet Message Format](http://tools.ietf.org/html/rfc5322)", RFC 5322, DOI 10.17487/RFC5322, October 2008.\n\n\n\n**\\[RFC5890\\]**\n\n\n\nKlensin, J., "[Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework](http://tools.ietf.org/html/rfc5890)", RFC 5890, DOI 10.17487/RFC5890, August 2010.\n\n\n\n**\\[RFC5891\\]**\n\n\n\nKlensin, J., "[Internationalized Domain Names in Applications (IDNA): Protocol](http://tools.ietf.org/html/rfc5891)", RFC 5891, DOI 10.17487/RFC5891, August 2010.\n\n\n\n**\\[RFC6570\\]**\n\n\n\nGregorio, J., Fielding, R., Hadley, M., Nottingham, M. and D. Orchard, "[URI Template](http://tools.ietf.org/html/rfc6570)", RFC 6570, DOI 10.17487/RFC6570, March 2012.\n\n\n\n**\\[RFC6531\\]**\n\n\n\nYao, J. and W. Mao, "[SMTP Extension for Internationalized Email](http://tools.ietf.org/html/rfc6531)", RFC 6531, DOI 10.17487/RFC6531, February 2012.\n\n\n\n**\\[RFC6901\\]**\n\n\n\nBryan, P., Zyp, K. and M. Nottingham, "[JavaScript Object Notation (JSON) Pointer](http://tools.ietf.org/html/rfc6901)", RFC 6901, DOI 10.17487/RFC6901, April 2013.\n\n\n\n**\\[RFC7159\\]**\n\n\n\nBray, T., [The JavaScript Object Notation (JSON) Data Interchange Format](http://tools.ietf.org/html/rfc7159)", RFC 7159, DOI 10.17487/RFC7159, March 2014.\n\n\n\n**\\[ecma262\\]**\n\n\n\n[ECMA 262 specification](http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf)"\n\n\n\n**\\[relative-json-pointer\\]**\n\n\n\nLuff, G. and H. Andrews, "[Relative JSON Pointers](http://tools.ietf.org/html/draft-handrews-relative-json-pointer-01)", Internet-Draft draft-handrews-relative-json-pointer-01, November 2017.\n\n\n\n**\\[json-schema\\]**\n\n\n\nWright, A. and H. Andrews, "[JSON Schema: A Media Type for Describing JSON Documents](http://tools.ietf.org/html/draft-handrews-json-schema-01)", Internet-Draft draft-handrews-json-schema-01, November 2017.\n\n\n\n[12.2.](#rfc.references.2) Informative References\n\n=================================================\n\n\n\n**\\[RFC4329\\]**\n\n\n\nHoehrmann, B., "[Scripting Media Types](http://tools.ietf.org/html/rfc4329)", RFC 4329, DOI 10.17487/RFC4329, April 2006.\n\n\n\n[Appendix A.](#rfc.appendix.A) Acknowledgments\n\n==============================================\n\n\n\nThanks to Gary Court, Francis Galiegue, Kris Zyp, and Geraint Luff for their work on the initial drafts of JSON Schema.\n\n\n\nThanks to Jason Desrosiers, Daniel Perrett, Erik Wilde, Ben Hutton, Evgeny Poberezkin, Brad Bowman, Gowry Sankar, Donald Pipowitch, Dave Finlay, and Denis Laxalde for their submissions and patches to the document.\n\n\n\n[Appendix B.](#rfc.appendix.B) ChangeLog\n\n========================================\n\n\n\n\\[CREF3\\]This section to be removed before leaving Internet-Draft status.\n\n\n\ndraft-handrews-json-schema-validation-01\n\n\n\n* This draft is purely a clarification with no functional changes\n\n* Provided the general principle behind ignoring annotations under "not" and similar cases\n\n* Clarified "if"/"then"/"else" validation interactions\n\n* Clarified "if"/"then"/"else" behavior for annotation\n\n* Minor formatting and cross-referencing improvements\n\n\n\ndraft-handrews-json-schema-validation-00\n\n\n\n* Added "if"/"then"/"else"\n\n* Classify keywords as assertions or annotations per the core spec\n\n* Warn of possibly removing "dependencies" in the future\n\n* Grouped validation keywords into sub-sections for readability\n\n* Moved "readOnly" from hyper-schema to validation meta-data\n\n* Added "writeOnly"\n\n* Added string-encoded media section, with former hyper-schema "media" keywords\n\n* Restored "regex" format (removal was unintentional)\n\n* Added "date" and "time" formats, and reserved additional RFC 3339 format names\n\n* I18N formats: "iri", "iri-reference", "idn-hostname", "idn-email"\n\n* Clarify that "json-pointer" format means string encoding, not URI fragment\n\n* Fixed typo that inverted the meaning of "minimum" and "exclusiveMinimum"\n\n* Move format syntax references into Normative References\n\n* JSON is a normative requirement\n\n\n\ndraft-wright-json-schema-validation-01\n\n\n\n* Standardized on hyphenated format names with full words ("uriref" becomes "uri-reference")\n\n* Add the formats "uri-template" and "json-pointer"\n\n* Changed "exclusiveMaximum"/"exclusiveMinimum" from boolean modifiers of "maximum"/"minimum" to independent numeric fields.\n\n* Split the additionalItems/items into two sections\n\n* Reworked properties/patternProperties/additionalProperties definition\n\n* Added "examples" keyword\n\n* Added "contains" keyword\n\n* Allow empty "required" and "dependencies" arrays\n\n* Fixed "type" reference to primitive types\n\n* Added "const" keyword\n\n* Added "propertyNames" keyword\n\n\n\ndraft-wright-json-schema-validation-00\n\n\n\n* Added additional security considerations\n\n* Removed reference to "latest version" meta-schema, use numbered version instead\n\n* Rephrased many keyword definitions for brevity\n\n* Added "uriref" format that also allows relative URI references\n\n\n\ndraft-fge-json-schema-validation-00\n\n\n\n* Initial draft.\n\n* Salvaged from draft v3.\n\n* Redefine the "required" keyword.\n\n* Remove "extends", "disallow"\n\n* Add "anyOf", "allOf", "oneOf", "not", "definitions", "minProperties", "maxProperties".\n\n* "dependencies" member values can no longer be single strings; at least one element is required in a property dependency array.\n\n* Rename "divisibleBy" to "multipleOf".\n\n* "type" arrays can no longer have schemas; remove "any" as a possible value.\n\n* Rework the "format" section; make support optional.\n\n* "format": remove attributes "phone", "style", "color"; rename "ip-address" to "ipv4"; add references for all attributes.\n\n* Provide algorithms to calculate schema(s) for array/object instances.\n\n* Add interoperability considerations.\n\n\n\n[Authors\' Addresses](#rfc.authors)\n\n==================================\n\n\n\nAustin Wright (editor) Wright EMail: [aaa@bzfx.net](mailto:aaa@bzfx.net)\n\n\n\nHenry Andrews (editor) Andrews Cloudflare, Inc. San Francisco, CA USA EMail: [henry@cloudflare.com](mailto:henry@cloudflare.com)\n\n\n\nGeraint Luff Luff Cambridge, UK EMail: [luffgd@gmail.com](mailto:luffgd@gmail.com)\n\n', + targetSpecs: [...AsyncAPI2, ...OpenAPI3], }, ]; export default documentation;