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":{
"version":{
"type":"integer",
"description":"Metadata file version"
},
"tools":{
"type":"array",
"description":"List of tools",
"items":{
"$ref":"#/definitions/toolInfo"
}
}
},
"required":[
"version",
"tools"
],
"definitions":{
"toolInfo":{
"type":"object",
"description":"Information about one tool",
"properties":{
"name":{
"description":"Tool name",
"type":"string"
},
"description":{
"description":"A short (one sentence) description of the tool.",
"type":"string"
},
"versions":{
"type":"array",
"description":"List of versions",
"items":{
"$ref":"#/definitions/versionInfo"
}
}
},
"required":[
"versions"
]
},
"versionInfo":{
"type":"object",
"properties":{
"name":{
"description":"Version ...",
"type":"string"
},
"status":{
"description":"Determines whether the version is recommended/supported/deprecated",
"type":"string",
"enum":[
"recommended",
"supported",
"deprecated"
]
},
"linux-i686":{
"$ref":"#/definitions/platformDownloadInfo"
},
"linux-amd64":{
"$ref":"#/definitions/platformDownloadInfo"
},
"linux-armel":{
"$ref":"#/definitions/platformDownloadInfo"
},
"linux-arm64":{
"$ref":"#/definitions/platformDownloadInfo"
},
"macos":{
"$ref":"#/definitions/platformDownloadInfo"
},
"win32":{
"$ref":"#/definitions/platformDownloadInfo"
},
"win64":{
"$ref":"#/definitions/platformDownloadInfo"
},
"any":{
"$ref":"#/definitions/platformDownloadInfo"
}
}
},
"platformDownloadInfo":{
"description":"Information about download artifact for one platform",
"type":"object",
"properties":{
"sha256":{
"type":"string",
"description":"SHA256 sum of the file"
},
"size":{
"type":"integer",
"description":"Size of the file, in bytes"
},
"url":{
"type":"string",
"description":"Download URL"
},
"rename_dist":{
"type":"string",
"description":"Filename under which the archive should be downloaded"
}
},
"required":[
"sha256",
"url",
"size"
]
}
},
"if":{
"properties":{
"version":{
"const":1
}
}
},
"then":{
"properties":{
"tools":{
"items":{
"properties":{
"versions":{
"items":{
"patternProperties":{
"^name":{},
"^status":{}
},
"additionalProperties":{
"not":{
"required":[
"rename_dist"
]
}
}
}
}
}
}
}
}
}
}
Valid JSON:
xxxxxxxxxx
{
"tools": [
{
"description": "Ninja build system",
"name": "ninja",
"versions": [
{
"linux-amd64": {
"rename_dist": "ninja-linux-v1.11.1.zip",
"sha256": "b901ba96e486dce377f9a070ed4ef3f79deb45f4ffe2938f8e7ddc69cfb3df77",
"size": 119463,
"url": "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip"
},
"macos": {
"rename_dist": "ninja-mac-v1.11.1.zip",
"sha256": "482ecb23c59ae3d4f158029112de172dd96bb0e97549c4b1ca32d8fad11f873e",
"size": 277306,
"url": "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip"
},
"macos-arm64": {
"rename_dist": "ninja-mac-v1.11.1.zip",
"sha256": "482ecb23c59ae3d4f158029112de172dd96bb0e97549c4b1ca32d8fad11f873e",
"size": 277306,
"url": "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip"
},
"name": "1.11.1",
"status": "recommended",
"win64": {
"rename_dist": "ninja-win-v1.11.1.zip",
"sha256": "524b344a1a9a55005eaf868d991e090ab8ce07fa109f1820d40e74642e289abc",
"size": 285922,
"url": "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip"
}
}
]
},
{
"description": "XXXX",
"name": "x-exe",
"versions": [
{
"name": "1.0.3",
"status": "recommended",
"win32": {
"sha256": "7c81ef534c562354a5402ab6b90a6eb1cc8473a9f4a7b7a7f93ebbd23b4a2755",
"size": 73562,
"url": "https://github.com/espressif/xxx-exe-v1.0.3.zip"
},
"win64": {
"sha256": "7c81ef534c562354a5402ab6b90a6eb1cc8473a9f4a7b7a7f93ebbd23b4a2755",
"size": 73562,
"url": "https://github.com/espressif/xxx-exe-v1.0.3.zip"
}
}
]
}
],
"version": 1
}
​
should NOT be valid.
not at "#/then/properties/tools/items/properties/versions/items/additionalProperties/not"
Instance location: "/tools/0/versions/0/linux-amd64"
should NOT be valid.
not at "#/then/properties/tools/items/properties/versions/items/additionalProperties/not"
Instance location: "/tools/0/versions/0/macos"
should NOT be valid.
not at "#/then/properties/tools/items/properties/versions/items/additionalProperties/not"
Instance location: "/tools/0/versions/0/macos-arm64"
should NOT be valid.
not at "#/then/properties/tools/items/properties/versions/items/additionalProperties/not"
Instance location: "/tools/0/versions/0/win64"
should match "then" schema.
if at "#/if"
Instance location: ""
jsonschema.dev@relequestual Thanks to Sponsors: