The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
xxxxxxxxxx
{
"$schema":"http://json-schema.org/draft-07/schema#",
"type":"object",
"properties":{
"someValue":{
"type":"integer"
},
"someObjectWithType":{
"oneOf":[
{
"type":"object",
"properties":{
"id":{
"type":"integer"
},
"type":{
"const":"TEXT"
},
"text":{
"type":"string"
}
},
"required":[
"text"
]
},
{
"type":"object",
"properties":{
"id":{
"type":"integer"
},
"type":{
"const":"DATE"
},
"date":{
"type":"string"
}
},
"required":[
"id",
"date"
]
}
]
}
},
"required":[
"someValue",
"someObjectWithType"
]
}
Valid JSON:
xxxxxxxxxx
{
"someValue":3,
"someObjectWithType":{
"id":3,
"type":"TEXT",
"date":"sdasd"
}
}
should have required property 'text'.
required at "#/properties/someObjectWithType/oneOf/0/required"
Instance location: "/someObjectWithType"
should be equal to constant.
const at "#/properties/someObjectWithType/oneOf/1/properties/type/const"
Instance location: "/someObjectWithType/type"
should match exactly one schema in oneOf.
oneOf at "#/properties/someObjectWithType/oneOf"
Instance location: "/someObjectWithType"
jsonschema.dev@relequestual Thanks to Sponsors: