Sample Schema
Validate against: http://json-schema.org/draft-07/schema#
Schema ID: https://raw.githubusercontent.com/dwhieb/jschemer/master/test/schemas/schema.json
Type: object
Description
This is a description of this schema. It should support basic inline HTML, as well as simple Markdown styling. This schema shows how each JSON Schema keyword appears on its own.
Schema Definitions
This schema defines the following subschemas for reuse:
keyRegular expression to match:
[A-Za-z]+
Properties
The following properties are defined for this object:
Annotation Keywords:
annotationsDescription
This schema shows how annotation keywords are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
titleKeyword:titleDescription
This schema shows how the “title” keyword appears in jschemer documentation. Titles should also support basic Markdown syntax.
“default” Keyword:
defaultDescription
This schema shows how the “default” keyword appears in jschemer documentation. The value of the “default” keyword should appear as an indented JSON string in a code block.
Default Value
The default value for this item is:
{ "id": "532708fd-b48e-48cb-9f3c-219f7aa53f80", "key": "LANG", "name": "language" }“description” Keyword:
descriptionDescription
This schema shows how the
"description"keyword appears in jschemer documentation. Descriptions should also support Markdown syntax.“examples” Keyword:
examplesDescription
This schema shows how the “examples” keyword appears in jschemer documentation. Each example should be displayed as an indented JSON string in a code block.
Examples
The following are example values for this schema:
-
{ "id": "532708fd-b48e-48cb-9f3c-219f7aa53f80", "key": "LANG", "name": "language" } -
{ "id": "1830a856-e826-418e-a6cb-782d207b1bae", "key": "MORPH", "name": "morpheme" }
-
“readOnly” Keyword:
readOnlyRead-only:
trueDescription
This schema shows how the “readOnly” keyword appears in jschemer documentation.
“writeOnly” Keyword:
writeOnlyDescription
This schema shows how the “writeOnly” keyword appears in jschemer documentation.
Keywords for Any Instance Type:
anyDescription
This schema shows how keywords that apply to any instance type are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“const” Keyword:
constDescription
This schema shows how the “const” keyword appears in jschemer documentation.
This item must have the following value:
"This is a constant value."“enum” Keyword:
enumDescription
This schema shows how the “enum” keyword appears in jschemer documentation.
Allowed Values
1[]{}true
“type” Keyword:
typeType:
stringDescription
This schema shows how the “type” keyword appears in jschemer documentation.
Keywords for Array Instance Types:
arraysDescription
This schema shows how keywords that apply to array instance types are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“additionalItems” Keyword:
additionalItemsDescription
This schema shows how the “additionalItems” keyword appears in jschemer documentation. This keyword only applies when the “items” keyword is also present, and consists of an array of schemas. In this example, the first item in the array must be a string, and any additional items in the array must be numbers.
Items
The items in this array must adhere to the following schemas, in order:
Type:
string
Additional Items
If there are additional items in the array, they must adhere to the following schema:
additionalItemsType:
number“contains” Keyword:
containsDescription
This schema shows how the “contains” keyword appears in jschemer documentation. In this example, at least one item in the array must be a string.
Contains
The array must contain at least one element that adheres to the following schema:
containsType:
string“items” Keyword as a Schema:
itemsSchemaDescription
This schema shows how the “items” keyword appears in jschemer documentation when the value of “items” is a single schema. In this example, each item must be a string with a minimum length of 1.
Items
Each item in this array must adhere to the following schema:
itemsSchemaType:
stringMinimum length:
1“items” Keyword as an Array:
itemsArrayDescription
This schema shows how the “items” keyword appears in jschemer documentation when the value of “items” is an array of schemas. In this example, the first item in the array must be
null, and the second item in the array must be a string.Items
The items in this array must adhere to the following schemas, in order:
Type:
nullType:
string
“maxItems” Keyword:
maxItemsDescription
This schema shows how the “maxItems” keyword appears in jschemer documentation.
Maximum number of items:
10“minItems” Keyword:
minItemsDescription
This schema shows how the “minItems” keyword appears in jschemer documentation.
Minimum number of items:
1“uniqueItems” Keyword:
uniqueItemsDescription
This schema show how the “uniqueItems” keyword appears in jschemer documentation.
Items must be unique:
true
Keywords for Boolean Logic:
booleansDescription
This schema shows how keywords that apply subschemas with boolean logic are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“allOf” Keyword:
allOfDescription
This schema shows how the “allOf” keyword appears in jschemer documentation. In this example, the instance must validate against both subschemas — it must have an “id” property and it must be an object.
This item must also validate against all of the following schemas:
Required Properties
id
Type:
object
“anyOf” Keyword:
anyOfDescription
This schema shows how the “anyOf” keyword appears in jschemer documentation. In this example, the instance can validate against any of the subschemas — it may be either an object or an array.
This item must also validate against at least one of the following schemas:
Type:
objectType:
array
“not” Keyword:
notDescription
This schema shows how the “not” keyword appears in jschemer documentation. In this example, the instance must not be null.
This item must not validate against the following schema:
notType:
null“oneOf” Keyword:
oneOfDescription
This schema shows how the “oneOf” keyword appears in jschemer documentation. In this example, the instance may be either an object or a string.
This item must also validate against exactly one of the following schemas:
Type:
objectType:
string
Keywords for Conditional Validation:
conditionalsDescription
This schema shows how keywords that apply subschemas conditionally are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“if”, “then”, and “else” Keywords:
ifThenDescription
This schema shows how the “if”, “then”, and “else” keywords are displayed in jschemer documentation. In this example, if the instance is a string, it must have a minimum length of 3 characters. If the instance is not a string, then it must be an object.
Conditional Valiation Rules
The following schema is used for conditional validation:
ifThenType:
stringIf this item validates aginst the conditional schema shown above, it must also validate against the following schema:
ifThenMinimum length:
3If this item does not validate against the conditional schema shown aboe, it must validate against the following schema instead:
ifThenType:
object
Keywords for Referenced Schemas:
referencesDescription
This schema shows how keywords that are defined by reference to other schemas are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
Schemas Defined in “definitions”:
definitionsDescription
This schema shows how schemas which reference definitions in the “definitions” property appear in jschemer documentation. In this example, the “key” property must validate against the “key” schema in the schema definitions.
Properties
The following properties are defined for this object:
keyReferenced Schema
This item must validate against the following schema:
Schemas Referenced with “$ref”:
refDescription
This schema shows how schemas which reference external schemas using the “$ref” property appear in jschemer documentation. In this example, the “location” property references the GeoJSON schema. This schema also shows that properties on the referencing schema overwrite properties on the referenced schema, for the purpose of generating the jschemer documentation. For example, the referenced GeoJSON schema in this example has the title
GeoJSON, but in the jschemer documentation this example will appear with the titleSchemas Referenced with "$ref".Referenced Schema
This item must validate against the following schema:
Keywords for Non-JSON Data:
nonJSONDescription
This schema shows how keywords that apply to non-JSON data encoded as a string are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“contentEncoding” Keyword:
contentEncodingDescription
This schema shows how the “contentEncoding” keyword appears in jschemer documentation.
Content encoding:
base64“contentMediaType” Keyword:
contentMediaTypeDescription
This schema shows how the “contentMediaType” keyword appears in jschemer documentation.
Content media type:
audio/wav
Keywords for Numeric Instance Types:
numericDescription
This schema shows how keywords that apply to numeric instance types are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“exclusiveMaximum” Keyword:
exclusiveMaximumDescription
This schema shows how the “exclusiveMaximum” keyword appears in jschemer documentation.
Exclusive maximum:
10“exclusiveMinimum” Keyword:
exclusiveMinimumDescription
This schema shows how the “exclusiveMinimum” keyword appears in jschemer documentation.
Exclusive minimum:
-10“maximum” Keyword:
maximumDescription
This schema shows how the “maximum” keyword appears in jschemer documentation.
Maximum:
9.99“minimum” Keyword:
minimumDescription
This schema shows how the “minimum” keyword appears in jschemer documentation.
Minimum:
-9.99“multipleOf” Keyword:
multipleOfDescription
This schema shows how the “multipleOf” keyword appears in jschemer documentation.
Multiple of:
2
Keywords for Object Instances:
objectsDescription
This schema shows how keywords that apply to object instances are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“additionalProperties” Keyword Set to Boolean:
additionalPropertiesTrueDescription
This schema shows how the “additionalProperties” keyword appears in jschemer documentation when it is set a boolean value. In this example, the object has one defined property, “id”, and no other properties are allowed.
Properties
The following properties are defined for this object:
idType:
string
Additional Properties
Any additional properties must adhere to the following schema:
No values are valid for this schema.
“additionalProperties” Keyword Set to a Schema:
additionalPropertiesSchemaDescription
This schema shows how the “additionalProperties” keyword appears in jschemer documentation when its value is another schema. In this example, the object has one defined property, “id”, but may have additional properties as long as those additional properties are strings.
Properties
The following properties are defined for this object:
idType:
string
Additional Properties
Any additional properties must adhere to the following schema:
additionalPropertiesSchemaType:
string“dependencies” Keyword:
dependenciesDescription
This schema shows how the “dependencies” keyword appears in jschemer documentation. In this example, the object has two dependencies: 1) if the object has an “id” property, it must also have a “key” property; 2) if the object has a “startTime” property, it must also have an “endTime” property.
Dependencies
This object has the following dependencies between properties:
-
If the object has the
idproperty, the object must also match the following schema:idRequired Properties
key
-
If this object has the
startTimeproperty, it must have the following properties as well:- endTime
-
“maxProperties” Keyword:
maxPropertiesDescription
This schema shows how the “maxProperties” keyword appears in jschemer documentation.
Maximum number of properties:
5“minProperties” Keyword:
minPropertiesDescription
This schema shows how the “minProperties” keyword appears in jschemer documentation.
Minimum number of properties:
1“patternProperties” Keyword:
patternPropertiesDescription
This schema shows how the “patternProperties” keyword appears in jschemer documentation. In this example, each property of the object must contain the string “-lang”, and the value of that property must be a string as well.
Regular Expression Properties
Property names which match one of the following regular expressions must validate against the associated schema.
-langType:
string
“properties” Keyword:
propertiesDescription
This schema shows how the “properties” keyword appears in jschemer documentation. In this example, the schema specifies two properties for the object: “id” and “name”, both of which must be strings.
Properties
The following properties are defined for this object:
idType:
stringnameType:
string
“propertyNames” Keyword:
propertyNamesDescription
This schema shows how the “propertyNames” keyword appears in jschemer documentation. In this example, each property name in the object must contain at least 3 characters.
Property Names
Each property name in this object must adhere to the following schema:
propertyNamesMinimum length:
3“required” Keyword:
requiredDescription
This schema shows how the “required” keyword appears in jschemer documentation. In this example, the object must have an “id” property.
Required Properties
id
Keywords for String Instances:
stringsDescription
This schema shows how keywords that apply to string instances are displayed in jschemer documentation.
Properties
The following properties are defined for this object:
“format” Keyword:
formatDescription
This schema shows how the “format” keyword appears in jschemer documentation.
Format:
date-time“maxLength” Keyword:
maxLengthDescription
This schema shows how the “maxLength” keyword appears in jschemer documentation.
Maximum length:
100“minLength” Keyword:
minLengthDescription
This schema shows how the “minLength” keyword appears in jschemer documentation.
Minimum length:
1“pattern” Keyword:
patternDescription
This schema shows how the “pattern” keyword appears in jschemer documentation.
Regular expression to match:
[A-Za-z]{4}
Miscellaneous Tests:
miscDescription
This schema provides a space to test other miscellaneous aspects of JSON Schema.
Properties
The following properties are defined for this object:
True Schema:
trueSchemaDescription
This schema shows how a schema whose value is
trueappears in jschemer documentation.Items
Each item in this array must adhere to the following schema:
This schema imposes no restrictions. All values are valid.
False Schema:
falseSchemaDescription
This schema shows how a schema whose value is
falseappears in jschemer documentation.Items
Each item in this array must adhere to the following schema:
No values are valid for this schema.
Developer Notes
This is a test comment, aimed at readers or maintainers of the schema. This will be displayed as “Developer Notes”.