Exclude skipped fields/variants from json schema

This commit is contained in:
Graham Esau 2019-09-12 19:07:25 +01:00
parent 709ba7b62e
commit 5de6bcfdef
5 changed files with 137 additions and 11 deletions

View file

@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyEnum",
"anyOf": [
{
"enum": [
"Included2"
]
},
{
"type": "object",
"properties": {
"Included1": {
"type": "number",
"format": "float"
}
},
"required": [
"Included1"
]
}
]
}

View file

@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MyStruct",
"type": "object",
"properties": {
"included1": {
"type": "number",
"format": "float"
},
"included2": {
"type": "null"
}
},
"required": [
"included1",
"included2"
]
}

View file

@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "TupleStruct",
"type": "array",
"items": [
{
"type": "number",
"format": "float"
},
{
"type": "null"
}
],
"maxItems": 2,
"minItems": 2
}