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

     1  -- list.yaml --
     2  type: object
     3  
     4  properties:
     5    foo:
     6      type: array
     7      items:
     8        type: string
     9  
    10    tuple:
    11      type: array
    12      items:
    13        - type: string
    14        - type: integer
    15        - const: 2
    16  
    17    has:
    18      type: array
    19      contains:
    20        const: 3
    21  
    22    size:
    23      type: array
    24      minItems: 3
    25      maxItems: 9
    26      uniqueItems: true
    27  
    28    additional:
    29      type: array
    30      items:
    31        - type: integer
    32        - type: integer
    33      additionalItems:
    34        type: string
    35  
    36  additionalProperties: false
    37  
    38  -- out/decode/cue --
    39  import "list"
    40  
    41  foo?: [...string]
    42  tuple?: [string, int, 2]
    43  has?: list.Contains(3)
    44  size?: list.UniqueItems() & list.MaxItems(9) & [_, _, _, ...]
    45  additional?: [int, int, ...string]