Exclude skipped fields/variants from json schema
This commit is contained in:
parent
709ba7b62e
commit
5de6bcfdef
5 changed files with 137 additions and 11 deletions
23
schemars/tests/expected/skip_enum_variants.json
Normal file
23
schemars/tests/expected/skip_enum_variants.json
Normal 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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
18
schemars/tests/expected/skip_struct_fields.json
Normal file
18
schemars/tests/expected/skip_struct_fields.json
Normal 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"
|
||||
]
|
||||
}
|
16
schemars/tests/expected/skip_tuple_fields.json
Normal file
16
schemars/tests/expected/skip_tuple_fields.json
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue