...

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

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

     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 --
    46constraint not allowed because type string is excluded:
    47    type.json:39:15
    48-- out.cue --
    49// Main schema
    50intOrString1?: int | string
    51intOrString2?: int | string
    52intOrString3?: string | int
    53disjunction?:  string | int | int & >=3
    54empty?:        _|_
    55...

View as plain text