github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/encoding/jsonschema/testdata/typedis.txtar (about) 1 -- type.json -- 2 { 3 "type": "object", 4 "title": "Main schema", 5 6 "properties": { 7 "intOrString1": { 8 "type": [ "string", "integer" ] 9 }, 10 "intOrString2": { 11 "oneOf": [ 12 { "type": "integer" }, 13 { "type": "string" } 14 ] 15 }, 16 "intOrString3": { 17 "anyOf": [ 18 { "type": "integer" }, 19 { "type": "string" } 20 ] 21 }, 22 23 "disjunction": { 24 "oneOf": [ 25 { 26 "anyOf": [ 27 { "type": "integer" }, 28 { "type": "string" } 29 ] 30 }, 31 { 32 "type": "integer", 33 "minimum": 3 34 } 35 ] 36 }, 37 "empty": { 38 "allOf": [ 39 { "type": "object" }, 40 { "type": "string" } 41 ] 42 } 43 } 44 } 45 -- out.err -- 46 constraint not allowed because type string is excluded: 47 type.json:39:15 48 -- out.cue -- 49 // Main schema 50 intOrString1?: int | string 51 intOrString2?: int | string 52 intOrString3?: string | int 53 disjunction?: string | int | int & >=3 54 empty?: _|_ 55 ...