@nju33/json-schema
Version:
[](https://www.npmjs.com/package/@nju33/json-schema)
54 lines (49 loc) • 786 B
JSON
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "JSON schema for test",
"type": "object",
"properties": {
"var": {
"type": "string",
"enum": ["foo", "hoge"],
"default": "foo"
}
},
"allOf": [
{
"if": {
"properties": {
"var": {
"const": "foo"
}
}
},
"then": {
"properties": {
"foo": {
"type": "string"
}
}
}
},
{
"if": {
"properties": {
"var": {
"const": "hoge"
}
}
},
"then": {
"properties": {
"hoge": {
"type": "string"
}
}
}
}
],
"dependencies": {
"foo": ["var"]
}
}