cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/txtar/type.txtar (about)

     1  -- schema.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/decode/extract --
    33  // Main schema
    34  
    35  close({
    36  	// an integer or string.
    37  	intString?: null | bool | int | string | [...]
    38  	object?: {
    39  		...
    40  	}
    41  	numOrList?: matchN(1, [number, [...number]])
    42  })