Skip to content

Commit 8045be9

Browse files
committed
Fix provider validation #6
1 parent dc24374 commit 8045be9

File tree

1 file changed

+55
-43
lines changed

1 file changed

+55
-43
lines changed

json-schema/schema.json

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
},
6060
{
6161
"$ref": "#/definitions/stac_extensions"
62+
},
63+
{
64+
"$ref": "#/definitions/providers"
6265
}
6366
],
6467
"anyOf": [
@@ -68,50 +71,11 @@
6871
"required": [
6972
"providers"
7073
],
71-
"properties": {
72-
"providers": {
73-
"type": "array",
74-
"minItems": 1,
75-
"items": {
76-
"type": "object",
77-
"oneOf": [
78-
{
79-
"allOf": [
80-
{
81-
"type": "object",
82-
"required": [
83-
"roles"
84-
],
85-
"properties": {
86-
"roles": {
87-
"type": "array",
88-
"contains": {
89-
"enum": [
90-
"producer",
91-
"processor"
92-
]
93-
}
94-
}
95-
}
96-
},
97-
{
98-
"$ref": "#/definitions/require_any_field"
99-
},
100-
{
101-
"$ref": "#/definitions/fields"
102-
}
103-
]
104-
},
105-
{
106-
"patternProperties": {
107-
"^(?!processing:)": {}
108-
},
109-
"additionalProperties": false
110-
}
111-
]
112-
}
74+
"allOf": [
75+
{
76+
"$ref": "#/definitions/providers"
11377
}
114-
}
78+
]
11579
},
11680
{
11781
"type": "object",
@@ -273,6 +237,54 @@
273237
"^(?!processing:)": {}
274238
},
275239
"additionalProperties": false
240+
},
241+
"providers": {
242+
"$comment": "Validate fields in Collection Providers.",
243+
"type": "object",
244+
"properties": {
245+
"providers": {
246+
"type": "array",
247+
"minItems": 1,
248+
"items": {
249+
"type": "object",
250+
"oneOf": [
251+
{
252+
"allOf": [
253+
{
254+
"type": "object",
255+
"required": [
256+
"roles"
257+
],
258+
"properties": {
259+
"roles": {
260+
"type": "array",
261+
"contains": {
262+
"enum": [
263+
"producer",
264+
"processor"
265+
]
266+
}
267+
}
268+
}
269+
},
270+
{
271+
"$ref": "#/definitions/require_any_field"
272+
},
273+
{
274+
"$ref": "#/definitions/fields"
275+
}
276+
]
277+
},
278+
{
279+
"patternProperties": {
280+
"^(?!processing:)": {}
281+
},
282+
"additionalProperties": false
283+
}
284+
]
285+
}
286+
}
287+
}
276288
}
277289
}
278290
}

0 commit comments

Comments
 (0)