schemars/schemars/tests/expected/schema_with-enum-internal.json
Graham Esau 3b3870ca82 Simplify flatten
No longer use it for internally-tagged enums. Instead, use a private helper that adds the tag property.
2024-05-13 10:52:42 +01:00

52 lines
No EOL
876 B
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Internal",
"oneOf": [
{
"type": "object",
"required": [
"foo",
"typeProperty"
],
"properties": {
"foo": {
"type": "boolean"
},
"typeProperty": {
"type": "string",
"enum": [
"Struct"
]
}
}
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"NewType"
]
}
}
},
{
"type": "object",
"required": [
"typeProperty"
],
"properties": {
"typeProperty": {
"type": "string",
"enum": [
"Unit"
]
}
}
}
]
}