{ "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "one-of-types": { "type": "object", "oneOf": [ { "properties": { "bar": { "type": "integer" } }, "required": [ "bar" ] }, { "properties": { "foo": { "type": "string" } }, "required": [ "foo" ] } ] }, "IpNet": { "$comment": "we want to see *nice* variant names in the output", "oneOf": [ { "title": "V4", "allOf": [ { "$ref": "#/components/schemas/Ipv4Net" } ] }, { "title": "V6", "allOf": [ { "$ref": "#/components/schemas/Ipv6Net" } ] } ] }, "Ipv4Net": { "type": "string" }, "Ipv6Net": { "type": "string" }, "NullStringEnumWithUnknownFormat": { "type": [ "string", "null" ], "enum": [ "a", "b", "c" ], "format": "?" }, "AlternativeEnum": { "type": "string", "default": "Choice2", "enum": [ "Choice1", "Choice2", "Choice3" ] }, "DiskAttachment": { "type": "object", "properties": { "state": { "type": "string", "enum": [ "Detached", "Destroyed", "Faulted" ], "default": "Detached" }, "alternate": { "$ref": "#/components/schemas/AlternativeEnum" } }, "required": [ "state", "alternate" ] }, "EmptyObject": { "type": "object", "properties": { "prop": { "type": "object", "enum": [ {} ] } } }, "JankNames": { "oneOf": [ { "title": "Animation Specification", "type": "string" }, { "title": "Animation Specification", "type": "object", "maxProperties": 1, "minProperties": 1, "additionalProperties": { "type": "string" } }, { "type": "object", "maxProperties": 2, "minProperties": 2, "additionalProperties": { "type": "integer" } } ] }, "References": { "description": "issue 280", "oneOf": [ { "type": "array", "items": { "type": "string" } }, { "$comment": "Mapping of mod name to the desired version", "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "#/definitions/StringVersion" }, { "$ref": "#/definitions/ReferenceDef" } ] } } ] }, "StringVersion": { "type": "string" }, "ReferenceDef": { "type": "string" }, "Never": false, "NeverEver": { "not": true }, "ShouldBeExclusive": { "type": "object", "properties": { "id": { "type": "string" }, "reference": { "type": "string" } }, "oneOf": [ { "required": [ "id" ] }, { "required": [ "reference" ] } ] }, "enum-and-constant": { "oneOf": [ { "type": "object", "required": [ "petType", "bark" ], "properties": { "petType": { "type": "string", "enum": [ "dog" ] }, "bark": { "type": "string" } } }, { "type": "object", "required": [ "petType", "purr" ], "properties": { "petType": { "type": "string", "const": "cat" }, "purr": { "type": "string" } } }, { "type": "object", "required": [ "petType", "help" ], "properties": { "petType": { "const": "monkey" }, "help": { "type": "string" } } }, { "type": "object", "required": [ "petType", "float" ], "properties": { "petType": { "enum": [ "fish" ] }, "float": { "type": "string" } } } ] }, "commented-variants": { "oneOf": [ { "enum": [ "A" ], "description": "An A" }, { "enum": [ "B" ], "description": "A B" }, { "const": "C", "description": "a pirate's favorite letter" } ] } } }