cuelang.org/go@v0.10.1/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    }
    38  }
    39  -- out/decode/cue --
    40  // Main schema
    41  intOrString1?: int | string
    42  intOrString2?: int | string
    43  intOrString3?: int | string
    44  disjunction?:  int | string | int & >=3
    45  ...