File tree Expand file tree Collapse file tree 1 file changed +93
-0
lines changed
encoding/jsonschema/testdata Expand file tree Collapse file tree 1 file changed +93
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- json-e.json --
2
+ {
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4
+ "$id": "https://www.sourcemeta.com/schemas/vendor/
[email protected] ",
5
+ "$comment": "https://json-e.js.org",
6
+ "$defs": {
7
+ "jsone-value": {
8
+ "oneOf": [
9
+ {
10
+ "$ref": "#"
11
+ },
12
+ {
13
+ "type": "array",
14
+ "items": {
15
+ "$ref": "#"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ "jsone-array": {
21
+ "type": "array",
22
+ "items": {
23
+ "$ref": "#/$defs/jsone-value"
24
+ }
25
+ },
26
+ "jsone-object-array": {
27
+ "type": "array",
28
+ "items": {
29
+ "$ref": "#"
30
+ }
31
+ }
32
+ },
33
+ "additionalProperties": {
34
+ "$ref": "#/$defs/jsone-value"
35
+ },
36
+ "properties": {
37
+ "$else": {
38
+ "$ref": "#/$defs/jsone-value"
39
+ },
40
+ "$let": {
41
+ "type": "object",
42
+ "additionalProperties": {
43
+ "additionalProperties": {
44
+ "$ref": "#"
45
+ }
46
+ }
47
+ },
48
+ "$sort": {
49
+ "anyOf": [
50
+ {
51
+ "$ref": "#"
52
+ },
53
+ {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "number"
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ "title": "JSON-e templates",
63
+ "type": "object"
64
+ }
65
+ -- out/decode/cue --
66
+ _schema
67
+ _schema: {
68
+ // JSON-e templates
69
+ @jsonschema(schema="https://json-schema.org/draft/2019-09/schema")
70
+ @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/
[email protected] ")
71
+ $else?: #["jsone-value"]
72
+ $let?: [string]: null | bool | number | string | [...] | {
73
+ [string]: _schema_1
74
+ }
75
+ $sort?: (_schema_5 | [...number]) & _
76
+ {[!~"^($else|$let|$sort)$"]: #["jsone-value"]}
77
+
78
+ #: "jsone-value": _schema_A | [..._schema_8]
79
+
80
+ #: "jsone-array": [...#["jsone-value"]]
81
+
82
+ #: "jsone-object-array": [..._schema_E]
83
+ }
84
+
85
+ let _schema_1 = _schema
86
+
87
+ let _schema_5 = _schema
88
+
89
+ let _schema_A = _schema
90
+
91
+ let _schema_8 = _schema
92
+
93
+ let _schema_E = _schema
You can’t perform that action at this time.
0 commit comments