...

Text file src/cuelang.org/go/encoding/jsonschema/testdata/used.txtar

Documentation: cuelang.org/go/encoding/jsonschema/testdata

     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.cue --
    44_
    45
    46#enum: "a" | "b" | "c"
    47
    48#lists: "a" | "b" | "c" | (["X"] | ["X", "a" | "b" | "c"] | ["X", "d" | "e" | "f"])

View as plain text