|
5 | 5 | "description": "STAC Processing Extension for STAC Items and STAC Collections.", |
6 | 6 | "anyOf": [ |
7 | 7 | { |
8 | | - "$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.", |
9 | | - "allOf": [ |
10 | | - { |
11 | | - "$ref": "#/definitions/stac_extensions" |
| 8 | + "$comment": "This is the schema for STAC Items.", |
| 9 | + "type": "object", |
| 10 | + "required": [ |
| 11 | + "type", |
| 12 | + "properties", |
| 13 | + "assets" |
| 14 | + ], |
| 15 | + "properties": { |
| 16 | + "type": { |
| 17 | + "const": "Feature" |
12 | 18 | }, |
13 | | - { |
14 | | - "type": "object", |
15 | | - "required": [ |
16 | | - "type", |
17 | | - "properties", |
18 | | - "assets" |
19 | | - ], |
20 | | - "properties": { |
21 | | - "type": { |
22 | | - "const": "Feature" |
23 | | - }, |
24 | | - "properties": { |
25 | | - "allOf": [ |
26 | | - { |
27 | | - "$ref": "#/definitions/require_any_field" |
28 | | - }, |
29 | | - { |
30 | | - "$ref": "#/definitions/fields" |
31 | | - } |
32 | | - ] |
| 19 | + "properties": { |
| 20 | + "allOf": [ |
| 21 | + { |
| 22 | + "$ref": "#/definitions/require_any_field" |
33 | 23 | }, |
34 | | - "assets": { |
35 | | - "$comment": "This validates the fields in Item Assets, but does not require them.", |
36 | | - "type": "object", |
37 | | - "additionalProperties": { |
38 | | - "$ref": "#/definitions/fields" |
39 | | - } |
| 24 | + { |
| 25 | + "$ref": "#/definitions/fields" |
40 | 26 | } |
| 27 | + ] |
| 28 | + }, |
| 29 | + "assets": { |
| 30 | + "$comment": "This validates the fields in Item Assets, but does not require them.", |
| 31 | + "type": "object", |
| 32 | + "additionalProperties": { |
| 33 | + "$ref": "#/definitions/fields" |
41 | 34 | } |
42 | 35 | } |
| 36 | + }, |
| 37 | + "allOf": [ |
| 38 | + { |
| 39 | + "$ref": "#/definitions/stac_extensions" |
| 40 | + } |
43 | 41 | ] |
44 | 42 | }, |
45 | 43 | { |
46 | 44 | "$comment": "This is the schema for STAC Collections.", |
47 | 45 | "type": "object", |
48 | | - "allOf": [ |
49 | | - { |
| 46 | + "required": [ |
| 47 | + "type" |
| 48 | + ], |
| 49 | + "properties": { |
| 50 | + "type": { |
| 51 | + "const": "Collection" |
| 52 | + }, |
| 53 | + "providers": { |
| 54 | + "type": "array", |
| 55 | + "items": { |
| 56 | + "$ref": "#/definitions/fields" |
| 57 | + } |
| 58 | + }, |
| 59 | + "item_assets": { |
50 | 60 | "type": "object", |
51 | | - "required": [ |
52 | | - "type" |
53 | | - ], |
54 | | - "properties": { |
55 | | - "type": { |
56 | | - "const": "Collection" |
57 | | - } |
| 61 | + "additionalProperties": { |
| 62 | + "$ref": "#/definitions/fields" |
58 | 63 | } |
59 | 64 | }, |
| 65 | + "summaries": { |
| 66 | + "$comment": "The values of summaries are not validated yet!" |
| 67 | + }, |
| 68 | + "assets": { |
| 69 | + "type": "object", |
| 70 | + "additionalProperties": { |
| 71 | + "$ref": "#/definitions/fields" |
| 72 | + } |
| 73 | + } |
| 74 | + }, |
| 75 | + "allOf": [ |
60 | 76 | { |
61 | 77 | "$ref": "#/definitions/stac_extensions" |
62 | 78 | } |
63 | 79 | ], |
64 | 80 | "anyOf": [ |
65 | 81 | { |
66 | | - "$comment": "Validate fields in Collection Providers.", |
| 82 | + "$comment": "Requires at least one provider to contain processing fields.", |
67 | 83 | "type": "object", |
68 | 84 | "required": [ |
69 | 85 | "providers" |
70 | 86 | ], |
71 | 87 | "properties": { |
72 | 88 | "providers": { |
73 | 89 | "type": "array", |
74 | | - "minItems": 1, |
75 | | - "items": { |
| 90 | + "contains": { |
76 | 91 | "type": "object", |
77 | | - "oneOf": [ |
| 92 | + "allOf": [ |
78 | 93 | { |
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 | | - } |
| 94 | + "type": "object", |
| 95 | + "required": [ |
| 96 | + "roles" |
| 97 | + ], |
| 98 | + "properties": { |
| 99 | + "roles": { |
| 100 | + "type": "array", |
| 101 | + "contains": { |
| 102 | + "enum": [ |
| 103 | + "producer", |
| 104 | + "processor" |
| 105 | + ] |
95 | 106 | } |
96 | | - }, |
97 | | - { |
98 | | - "$ref": "#/definitions/require_any_field" |
99 | | - }, |
100 | | - { |
101 | | - "$ref": "#/definitions/fields" |
102 | 107 | } |
103 | | - ] |
| 108 | + } |
104 | 109 | }, |
105 | 110 | { |
106 | | - "patternProperties": { |
107 | | - "^(?!processing:)": {} |
108 | | - }, |
109 | | - "additionalProperties": false |
| 111 | + "$ref": "#/definitions/require_any_field" |
110 | 112 | } |
111 | 113 | ] |
112 | 114 | } |
113 | 115 | } |
114 | 116 | } |
115 | 117 | }, |
116 | 118 | { |
| 119 | + "$comment": "Requires at least one asset to contain processing fields.", |
117 | 120 | "type": "object", |
118 | | - "$comment": "This validates the fields in Collection Assets, but does not require them.", |
119 | 121 | "required": [ |
120 | 122 | "assets" |
121 | 123 | ], |
|
125 | 127 | "not": { |
126 | 128 | "additionalProperties": { |
127 | 129 | "not": { |
128 | | - "allOf": [ |
129 | | - { |
130 | | - "$ref": "#/definitions/require_any_field" |
131 | | - }, |
132 | | - { |
133 | | - "$ref": "#/definitions/fields" |
134 | | - } |
135 | | - ] |
| 130 | + "$ref": "#/definitions/require_any_field" |
136 | 131 | } |
137 | 132 | } |
138 | 133 | } |
139 | 134 | } |
140 | 135 | } |
141 | 136 | }, |
142 | 137 | { |
| 138 | + "$comment": "Requires at least one item asset definition to contain processing fields.", |
143 | 139 | "type": "object", |
144 | | - "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", |
145 | 140 | "required": [ |
146 | 141 | "item_assets" |
147 | 142 | ], |
|
151 | 146 | "not": { |
152 | 147 | "additionalProperties": { |
153 | 148 | "not": { |
154 | | - "allOf": [ |
155 | | - { |
156 | | - "$ref": "#/definitions/require_any_field" |
157 | | - }, |
158 | | - { |
159 | | - "$ref": "#/definitions/fields" |
160 | | - } |
161 | | - ] |
| 149 | + "$ref": "#/definitions/require_any_field" |
162 | 150 | } |
163 | 151 | } |
164 | 152 | } |
|
167 | 155 | }, |
168 | 156 | { |
169 | 157 | "type": "object", |
170 | | - "$comment": "This is the schema for the fields in Summaries. By default, only checks the existance of the properties, but not the schema of the summaries.", |
| 158 | + "$comment": "Requires at least one summary to be a processing field.", |
171 | 159 | "required": [ |
172 | 160 | "summaries" |
173 | 161 | ], |
|
195 | 183 | } |
196 | 184 | } |
197 | 185 | }, |
| 186 | + "require_provider_role": { |
| 187 | + "type": "object", |
| 188 | + "required": [ |
| 189 | + "roles" |
| 190 | + ], |
| 191 | + "properties": { |
| 192 | + "roles": { |
| 193 | + "type": "array", |
| 194 | + "contains": { |
| 195 | + "enum": [ |
| 196 | + "producer", |
| 197 | + "processor" |
| 198 | + ] |
| 199 | + } |
| 200 | + } |
| 201 | + } |
| 202 | + }, |
198 | 203 | "require_any_field": { |
199 | | - "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", |
200 | 204 | "anyOf": [ |
201 | 205 | {"type": "object", "required": ["processing:expression"]}, |
202 | 206 | {"type": "object", "required": ["processing:lineage"]}, |
|
206 | 210 | ] |
207 | 211 | }, |
208 | 212 | "fields": { |
209 | | - "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", |
210 | 213 | "type": "object", |
211 | 214 | "properties": { |
212 | 215 | "processing:expression": { |
|
0 commit comments