The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
xxxxxxxxxx
{
"type": "array",
"items": {
"type": "object",
"properties": {
"lessonSlug": {
"type": "string"
},
"lessonTitle": {
"type": "string"
},
"starterQuiz": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"properties": {
"question": {
"type": "string"
},
"questionType": {
"type": "string",
"enum": [
"multiple-choice",
"short-answer",
"match",
"order"
]
}
},
"required": [
"question",
"questionType"
]
},
{
"anyOf": [
{
"type": "object",
"properties": {
"questionType": {
"type": "string",
"const": "multiple-choice"
},
"answers": {
"type": "array",
"items": {
"allOf": [
{
"type": "object",
"properties": {
"distractor": {
"type": "boolean"
}
},
"required": [
"distractor"
]
},
{
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "text"
},
"content": {
"type": "string"
}
},
"required": [
"type",
"content"
],
"additionalProperties": false
}
]
}
]
}
}
},
"required": [
"questionType",
"answers"
],
"additionalProperties": false,
"description": "Multiple choice answer allows for one or more than one answer to be correct as defined by the distractor field being set to false"
}
]
}
]
}
}
},
"required": [
"lessonSlug",
"lessonTitle",
"starterQuiz"
],
"additionalProperties": false
}
}
Valid JSON:
xxxxxxxxxx
[
{
"lessonSlug": "design-an-underwater-weaving",
"lessonTitle": "Design an underwater weaving",
"starterQuiz": [
{
"question": "Which shapes can you see in this image?",
"questionType": "multiple-choice",
"answers": [
{
"distractor": false,
"this should not be allowed": true,
"type": true,
"content": "circular shapes"
},
{
"distractor": true,
"type": "text",
"content": "rectangular shapes"
},
{
"distractor": true,
"type": "text",
"content": "geometric shapes"
}
]
}
]
}
]
should NOT have additional properties.
additionalProperties at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/additionalProperties"
Instance location: "/0/starterQuiz/0"
should NOT have additional properties.
additionalProperties at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/additionalProperties"
Instance location: "/0/starterQuiz/0/answers/0"
should NOT have additional properties.
additionalProperties at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/additionalProperties"
Instance location: "/0/starterQuiz/0/answers/0"
should be string.
type at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/properties/type/type"
Instance location: "/0/starterQuiz/0/answers/0/type"
should be equal to constant.
const at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/properties/type/const"
Instance location: "/0/starterQuiz/0/answers/0/type"
should match some schema in anyOf.
anyOf at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf"
Instance location: "/0/starterQuiz/0/answers/0"
should NOT have additional properties.
additionalProperties at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/additionalProperties"
Instance location: "/0/starterQuiz/0/answers/1"
should match some schema in anyOf.
anyOf at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf"
Instance location: "/0/starterQuiz/0/answers/1"
should NOT have additional properties.
additionalProperties at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf/0/additionalProperties"
Instance location: "/0/starterQuiz/0/answers/2"
should match some schema in anyOf.
anyOf at "#/items/properties/starterQuiz/items/allOf/1/anyOf/0/properties/answers/items/allOf/1/anyOf"
Instance location: "/0/starterQuiz/0/answers/2"
should match some schema in anyOf.
anyOf at "#/items/properties/starterQuiz/items/allOf/1/anyOf"
Instance location: "/0/starterQuiz/0"
jsonschema.dev@relequestual Thanks to Sponsors: