{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "MyStruct", "type": "object", "properties": { "myBool": { "type": "boolean" }, "myNullableEnum": { "anyOf": [ { "$ref": "#/$defs/MyEnum" }, { "type": "null" } ], "default": null }, "myNumber": { "type": "integer", "format": "int32" } }, "additionalProperties": false, "required": [ "myNumber", "myBool" ], "$defs": { "MyEnum": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "floats": { "type": "array", "items": { "type": "number", "format": "float" } } }, "required": [ "floats" ] } ] } } }