cuelang.org/go@v0.10.1/encoding/jsonschema/testdata/used.txtar (about)

     1  -- used.json --
     2  {
     3      "$defs": {
     4          "enum": {
     5              "type": "string",
     6              "enum": [ "a", "b", "c" ]
     7          },
     8          "lists": {
     9              "description": "Single item or lists of various lengths.",
    10              "oneOf": [
    11                  {
    12                      "type": "string",
    13                      "enum": [ "a", "b", "c" ]
    14                  },
    15                  {
    16                      "type": "array",
    17                      "oneOf": [
    18                          {
    19                              "items": [ { "const": "X" } ]
    20                          },
    21                          {
    22                              "items": [
    23                                  { "const": "X" },
    24                                  {
    25                                      "type": "string",
    26                                      "enum": [ "a", "b", "c" ]
    27                                  }
    28                              ]
    29                          },
    30                          {
    31                              "items": [
    32                                  { "const": "X" },
    33                                  { "enum": [ "d", "e", "f" ] }
    34                              ]
    35                          }
    36                      ],
    37                      "additionalItems": false
    38                  }
    39              ]
    40          }
    41      }
    42  }
    43  -- out/decode/cue --
    44  _
    45  
    46  #enum: "a" | "b" | "c"
    47  
    48  #lists: "a" | "b" | "c" | (["X"] | ["X", "a" | "b" | "c"] | ["X", "d" | "e" | "f"])