...

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

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

     1-- type.json --
     2{
     3  "type": "object",
     4  "title": "Main schema",
     5
     6  "properties": {
     7    "intString": {
     8      "description": "an integer or string.",
     9      "type": [ "string", "integer", "boolean", "array", "null" ]
    10    },
    11    "object": {
    12        "type": "object",
    13        "default": {
    14            "foo": "bar",
    15            "baz": 1.3
    16        }
    17    },
    18    "numOrList": {
    19      "oneOf": [
    20        { "type": "number" },
    21        {
    22          "type": "array",
    23          "items": { "type": "number" }
    24        }
    25      ],
    26      "default": [ 1, 2, 3 ]
    27    }
    28  },
    29  "additionalProperties": false
    30}
    31
    32-- out.cue --
    33// Main schema
    34intString?: null | bool | int | string | [...]
    35object?: {
    36	...
    37} | *{
    38	foo: "bar"
    39	baz: 1.3
    40	...
    41}
    42numOrList?: number | [...number] | *[1, 2, 3]

View as plain text