...
1-- list.yaml --
2type: object
3
4properties:
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
36additionalProperties: false
37
38-- out.cue --
39import "list"
40
41foo?: [...string]
42tuple?: [string, int, 2]
43has?: list.Contains(3)
44size?: list.UniqueItems() & list.MaxItems(9) & [_, _, _, ...]
45additional?: [int, int, ...string]
View as plain text