| { |
| "$schema": "http://json-schema.org/draft-07/schema#", |
| "title": "MyStruct", |
| "type": "object", |
| "required": [ |
| "myBool", |
| "myNumber", |
| "myVecStr" |
| ], |
| "properties": { |
| "myBool": { |
| "type": "boolean" |
| }, |
| "myNullableEnum": { |
| "default": null, |
| "anyOf": [ |
| { |
| "$ref": "#/definitions/MyEnum" |
| }, |
| { |
| "type": "null" |
| } |
| ] |
| }, |
| "myNumber": { |
| "type": "integer", |
| "format": "int32", |
| "maximum": 10.0, |
| "minimum": 1.0 |
| }, |
| "myVecStr": { |
| "type": "array", |
| "items": { |
| "type": "string", |
| "pattern": "^x$" |
| } |
| } |
| }, |
| "additionalProperties": false, |
| "definitions": { |
| "MyEnum": { |
| "anyOf": [ |
| { |
| "type": "string", |
| "format": "phone" |
| }, |
| { |
| "type": "object", |
| "required": [ |
| "floats" |
| ], |
| "properties": { |
| "floats": { |
| "type": "array", |
| "items": { |
| "type": "number", |
| "format": "float" |
| }, |
| "maxItems": 100, |
| "minItems": 1 |
| } |
| } |
| } |
| ] |
| } |
| } |
| } |