Skip to content

Commit

Permalink
Fix provider validation #6
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 11, 2021
1 parent dc24374 commit 8045be9
Showing 1 changed file with 55 additions and 43 deletions.
98 changes: 55 additions & 43 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
},
{
"$ref": "#/definitions/stac_extensions"
},
{
"$ref": "#/definitions/providers"
}
],
"anyOf": [
Expand All @@ -68,50 +71,11 @@
"required": [
"providers"
],
"properties": {
"providers": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"oneOf": [
{
"allOf": [
{
"type": "object",
"required": [
"roles"
],
"properties": {
"roles": {
"type": "array",
"contains": {
"enum": [
"producer",
"processor"
]
}
}
}
},
{
"$ref": "#/definitions/require_any_field"
},
{
"$ref": "#/definitions/fields"
}
]
},
{
"patternProperties": {
"^(?!processing:)": {}
},
"additionalProperties": false
}
]
}
"allOf": [
{
"$ref": "#/definitions/providers"
}
}
]
},
{
"type": "object",
Expand Down Expand Up @@ -273,6 +237,54 @@
"^(?!processing:)": {}
},
"additionalProperties": false
},
"providers": {
"$comment": "Validate fields in Collection Providers.",
"type": "object",
"properties": {
"providers": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"oneOf": [
{
"allOf": [
{
"type": "object",
"required": [
"roles"
],
"properties": {
"roles": {
"type": "array",
"contains": {
"enum": [
"producer",
"processor"
]
}
}
}
},
{
"$ref": "#/definitions/require_any_field"
},
{
"$ref": "#/definitions/fields"
}
]
},
{
"patternProperties": {
"^(?!processing:)": {}
},
"additionalProperties": false
}
]
}
}
}
}
}
}

0 comments on commit 8045be9

Please sign in to comment.