Skip to content

Commit f40a738

Browse files
committed
refactor: Update schema to the correct, more strict format
1 parent 89ceec8 commit f40a738

16 files changed

Lines changed: 89 additions & 15 deletions

File tree

packages/project/lib/validation/schema/specVersion/kind/extension.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
},
2323
"if": {
24+
"type": "object",
2425
"properties": {
2526
"type": {"const": null}
2627
},
@@ -29,6 +30,7 @@
2930
"then": {},
3031
"else": {
3132
"if": {
33+
"type": "object",
3234
"properties": {
3335
"type": {"const": "task"}
3436
}
@@ -38,6 +40,7 @@
3840
},
3941
"else": {
4042
"if": {
43+
"type": "object",
4144
"properties": {
4245
"type": {"const": "server-middleware"}
4346
}
@@ -47,6 +50,7 @@
4750
},
4851
"else": {
4952
"if": {
53+
"type": "object",
5054
"properties": {
5155
"type": {"const": "project-shim"}
5256
}

packages/project/lib/validation/schema/specVersion/kind/extension/project-shim.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"type": "object",
66
"required": ["specVersion", "kind", "type", "metadata", "shims"],
77
"if": {
8+
"type": "object",
89
"properties": {
910
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0", "5.0"] }
1011
}
1112
},
1213
"then": {
14+
"type": "object",
1315
"additionalProperties": false,
1416
"properties": {
1517
"specVersion": {
@@ -35,11 +37,13 @@
3537
},
3638
"else": {
3739
"if": {
40+
"type": "object",
3841
"properties": {
3942
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
4043
}
4144
},
4245
"then": {
46+
"type": "object",
4347
"additionalProperties": false,
4448
"properties": {
4549
"specVersion": {

packages/project/lib/validation/schema/specVersion/kind/extension/server-middleware.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
}
1212
},
1313
"then": {
14+
"type": "object",
1415
"additionalProperties": false,
1516
"properties": {
1617
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0", "5.0"] },
@@ -34,11 +35,13 @@
3435
},
3536
"else": {
3637
"if": {
38+
"type": "object",
3739
"properties": {
3840
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
3941
}
4042
},
4143
"then": {
44+
"type": "object",
4245
"additionalProperties": false,
4346
"properties": {
4447
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] },

packages/project/lib/validation/schema/specVersion/kind/extension/task.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"type": "object",
66
"required": ["specVersion", "kind", "type", "metadata", "task"],
77
"if": {
8+
"type": "object",
89
"properties": {
910
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0", "5.0"] }
1011
}
1112
},
1213
"then": {
14+
"type": "object",
1315
"additionalProperties": false,
1416
"properties": {
1517
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0", "5.0"] },
@@ -33,11 +35,13 @@
3335
},
3436
"else": {
3537
"if": {
38+
"type": "object",
3639
"properties": {
3740
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
3841
}
3942
},
4043
"then": {
44+
"type": "object",
4145
"additionalProperties": false,
4246
"properties": {
4347
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] },

packages/project/lib/validation/schema/specVersion/kind/project.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"allOf": [
88
{
99
"if": {
10+
"type": "object",
1011
"required": ["type"],
1112
"properties": {
1213
"type": {
@@ -15,6 +16,7 @@
1516
}
1617
},
1718
"then": {
19+
"type": "object",
1820
"properties": {
1921
"specVersion": {
2022
"enum": ["5.0"],
@@ -41,6 +43,7 @@
4143
}
4244
},
4345
"if": {
46+
"type": "object",
4447
"properties": {
4548
"type": {"const": null}
4649
},
@@ -49,6 +52,7 @@
4952
"then": {},
5053
"else": {
5154
"if": {
55+
"type": "object",
5256
"properties": {
5357
"type": {"const": "application"}
5458
}
@@ -58,6 +62,7 @@
5862
},
5963
"else": {
6064
"if": {
65+
"type": "object",
6166
"properties": {
6267
"type": {"const": "library"}
6368
}
@@ -67,6 +72,7 @@
6772
},
6873
"else": {
6974
"if": {
75+
"type": "object",
7076
"properties": {
7177
"type": {"const": "theme-library"}
7278
}
@@ -76,6 +82,7 @@
7682
},
7783
"else": {
7884
"if": {
85+
"type": "object",
7986
"properties": {
8087
"type": {"const": "module"}
8188
}
@@ -85,6 +92,7 @@
8592
},
8693
"else": {
8794
"if": {
95+
"type": "object",
8896
"properties": {
8997
"type": {"const": "component"}
9098
}
@@ -175,7 +183,6 @@
175183
},
176184
"builder-bundles": {
177185
"type": "array",
178-
"additionalProperties": false,
179186
"items": {
180187
"type": "object",
181188
"additionalProperties": false,
@@ -191,7 +198,6 @@
191198
},
192199
"builder-bundles-2.4": {
193200
"type": "array",
194-
"additionalProperties": false,
195201
"items": {
196202
"type": "object",
197203
"additionalProperties": false,
@@ -207,7 +213,6 @@
207213
},
208214
"builder-bundles-3.0": {
209215
"type": "array",
210-
"additionalProperties": false,
211216
"items": {
212217
"type": "object",
213218
"additionalProperties": false,
@@ -223,7 +228,6 @@
223228
},
224229
"builder-bundles-3.2": {
225230
"type": "array",
226-
"additionalProperties": false,
227231
"items": {
228232
"type": "object",
229233
"additionalProperties": false,
@@ -239,7 +243,6 @@
239243
},
240244
"builder-bundles-4.0": {
241245
"type": "array",
242-
"additionalProperties": false,
243246
"items": {
244247
"type": "object",
245248
"additionalProperties": false,
@@ -445,6 +448,7 @@
445448
"type": "array",
446449
"items": {
447450
"if": {
451+
"type": "object",
448452
"properties": {
449453
"mode": {
450454
"const": "require"
@@ -771,24 +775,28 @@
771775
"not": {
772776
"anyOf": [
773777
{
778+
"type": "object",
774779
"properties": {
775780
"optional": {"enum": [false, null]}
776781
}
777782
},
778783
{
784+
"type": "object",
779785
"properties": {
780786
"development": {"enum": [false, null]}
781787
}
782788
},
783789
{
784790
"not": {
791+
"type": "object",
785792
"properties": {
786793
"optional": {"type": "boolean"}
787794
}
788795
}
789796
},
790797
{
791798
"not": {
799+
"type": "object",
792800
"properties": {
793801
"development": {"type": "boolean"}
794802
}
@@ -799,6 +807,7 @@
799807
}
800808
},
801809
"then": {
810+
"type": "object",
802811
"additionalProperties": false,
803812
"properties": {
804813
"name": {

packages/project/lib/validation/schema/specVersion/kind/project/application.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"type": "object",
66
"required": ["specVersion", "type", "metadata"],
77
"if": {
8+
"type": "object",
89
"properties": {
910
"specVersion": { "enum": ["4.0", "5.0"] }
1011
}
1112
},
1213
"then": {
14+
"type": "object",
1315
"additionalProperties": false,
1416
"properties": {
1517
"specVersion": { "enum": ["4.0", "5.0"] },
@@ -42,11 +44,13 @@
4244
},
4345
"else": {
4446
"if": {
47+
"type": "object",
4548
"properties": {
4649
"specVersion": { "enum": ["3.2"] }
4750
}
4851
},
4952
"then": {
53+
"type": "object",
5054
"additionalProperties": false,
5155
"properties": {
5256
"specVersion": { "enum": ["3.2"] },
@@ -80,11 +84,13 @@
8084
"else": {
8185

8286
"if": {
87+
"type": "object",
8388
"properties": {
8489
"specVersion": { "enum": ["3.0", "3.1"] }
8590
}
8691
},
8792
"then": {
93+
"type": "object",
8894
"additionalProperties": false,
8995
"properties": {
9096
"specVersion": { "enum": ["3.0", "3.1"] },
@@ -117,11 +123,13 @@
117123
},
118124
"else": {
119125
"if": {
126+
"type": "object",
120127
"properties": {
121128
"specVersion": { "enum": ["2.6"] }
122129
}
123130
},
124131
"then": {
132+
"type": "object",
125133
"additionalProperties": false,
126134
"properties": {
127135
"specVersion": { "enum": ["2.6"] },
@@ -154,11 +162,13 @@
154162
},
155163
"else": {
156164
"if": {
165+
"type": "object",
157166
"properties": {
158167
"specVersion": { "enum": ["2.5"] }
159168
}
160169
},
161170
"then": {
171+
"type": "object",
162172
"additionalProperties": false,
163173
"properties": {
164174
"specVersion": { "enum": ["2.5"] },
@@ -191,11 +201,13 @@
191201
},
192202
"else": {
193203
"if": {
204+
"type": "object",
194205
"properties": {
195206
"specVersion": { "enum": ["2.4"] }
196207
}
197208
},
198209
"then": {
210+
"type": "object",
199211
"additionalProperties": false,
200212
"properties": {
201213
"specVersion": { "enum": ["2.4"] },
@@ -228,11 +240,13 @@
228240
},
229241
"else": {
230242
"if": {
243+
"type": "object",
231244
"properties": {
232245
"specVersion": { "enum": ["2.3"] }
233246
}
234247
},
235248
"then": {
249+
"type": "object",
236250
"additionalProperties": false,
237251
"properties": {
238252
"specVersion": { "enum": ["2.3"] },
@@ -265,11 +279,13 @@
265279
},
266280
"else": {
267281
"if": {
282+
"type": "object",
268283
"properties": {
269284
"specVersion": { "enum": ["2.1", "2.2"] }
270285
}
271286
},
272287
"then": {
288+
"type": "object",
273289
"additionalProperties": false,
274290
"properties": {
275291
"specVersion": { "enum": ["2.1", "2.2"] },

packages/project/lib/validation/schema/specVersion/kind/project/component.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"type": "object",
66
"required": ["specVersion", "type", "metadata"],
77
"if": {
8+
"type": "object",
89
"properties": {
910
"specVersion": { "enum": ["5.0"] }
1011
}
1112
},
1213
"then": {
14+
"type": "object",
1315
"additionalProperties": false,
1416
"properties": {
1517
"specVersion": { "enum": ["5.0"] },

0 commit comments

Comments
 (0)