| 1 | { |
| 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | "title": "MyStruct", |
| 4 | "type": "object", |
| 5 | "properties": { |
| 6 | "my_bool": { |
| 7 | "type": "boolean" |
| 8 | }, |
| 9 | "my_int": { |
| 10 | "type": "integer", |
| 11 | "format": "int32" |
| 12 | }, |
| 13 | "my_nullable_enum": { |
| 14 | "anyOf": [ |
| 15 | { |
| 16 | "$ref": "#/$defs/MyEnum" |
| 17 | }, |
| 18 | { |
| 19 | "type": "null" |
| 20 | } |
| 21 | ] |
| 22 | } |
| 23 | }, |
| 24 | "required": [ |
| 25 | "my_int", |
| 26 | "my_bool" |
| 27 | ], |
| 28 | "$defs": { |
| 29 | "MyEnum": { |
| 30 | "oneOf": [ |
| 31 | { |
| 32 | "type": "object", |
| 33 | "properties": { |
| 34 | "StringNewType": { |
| 35 | "type": "string" |
| 36 | } |
| 37 | }, |
| 38 | "additionalProperties": false, |
| 39 | "required": [ |
| 40 | "StringNewType" |
| 41 | ] |
| 42 | }, |
| 43 | { |
| 44 | "type": "object", |
| 45 | "properties": { |
| 46 | "StructVariant": { |
| 47 | "type": "object", |
| 48 | "properties": { |
| 49 | "floats": { |
| 50 | "type": "array", |
| 51 | "items": { |
| 52 | "type": "number", |
| 53 | "format": "float" |
| 54 | } |
| 55 | } |
| 56 | }, |
| 57 | "required": [ |
| 58 | "floats" |
| 59 | ] |
| 60 | } |
| 61 | }, |
| 62 | "additionalProperties": false, |
| 63 | "required": [ |
| 64 | "StructVariant" |
| 65 | ] |
| 66 | } |
| 67 | ] |
| 68 | } |
| 69 | } |
| 70 | } |