| 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 | "maximum": 10, |
| 23 | "minimum": 1 |
| 24 | }, |
| 25 | "myVecStr": { |
| 26 | "type": "array", |
| 27 | "items": { |
| 28 | "type": "string", |
| 29 | "pattern": "^x$" |
| 30 | } |
| 31 | } |
| 32 | }, |
| 33 | "additionalProperties": false, |
| 34 | "required": [ |
| 35 | "myNumber", |
| 36 | "myBool", |
| 37 | "myVecStr" |
| 38 | ], |
| 39 | "x-customProperty": "example", |
| 40 | "$defs": { |
| 41 | "MyEnum": { |
| 42 | "anyOf": [ |
| 43 | { |
| 44 | "type": "string", |
| 45 | "format": "email" |
| 46 | }, |
| 47 | { |
| 48 | "type": "object", |
| 49 | "properties": { |
| 50 | "floats": { |
| 51 | "type": "array", |
| 52 | "items": { |
| 53 | "type": "number", |
| 54 | "format": "float" |
| 55 | }, |
| 56 | "maxItems": 100, |
| 57 | "minItems": 1 |
| 58 | } |
| 59 | }, |
| 60 | "required": [ |
| 61 | "floats" |
| 62 | ] |
| 63 | } |
| 64 | ] |
| 65 | } |
| 66 | } |
| 67 | } |