| 1 | { |
| 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | "title": "MyStruct", |
| 4 | "type": "object", |
| 5 | "properties": { |
| 6 | "myBool": { |
| 7 | "type": "boolean" |
| 8 | }, |
| 9 | "myNullableEnum": { |
| 10 | "anyOf": [ |
| 11 | { |
| 12 | "$ref": "#/$defs/MyEnum" |
| 13 | }, |
| 14 | { |
| 15 | "type": "null" |
| 16 | } |
| 17 | ], |
| 18 | "default": null |
| 19 | }, |
| 20 | "myNumber": { |
| 21 | "type": "integer", |
| 22 | "format": "int32" |
| 23 | } |
| 24 | }, |
| 25 | "additionalProperties": false, |
| 26 | "required": [ |
| 27 | "myNumber", |
| 28 | "myBool" |
| 29 | ], |
| 30 | "$defs": { |
| 31 | "MyEnum": { |
| 32 | "anyOf": [ |
| 33 | { |
| 34 | "type": "string" |
| 35 | }, |
| 36 | { |
| 37 | "type": "object", |
| 38 | "properties": { |
| 39 | "floats": { |
| 40 | "type": "array", |
| 41 | "items": { |
| 42 | "type": "number", |
| 43 | "format": "float" |
| 44 | } |
| 45 | } |
| 46 | }, |
| 47 | "required": [ |
| 48 | "floats" |
| 49 | ] |
| 50 | } |
| 51 | ] |
| 52 | } |
| 53 | } |
| 54 | } |