|
24 | 24 | "properties": { |
25 | 25 | "allOf": [ |
26 | 26 | { |
27 | | - "$ref": "#/definitions/require_any_field" |
| 27 | + "$ref": "#/definitions/fields" |
28 | 28 | }, |
29 | 29 | { |
30 | 30 | "$ref": "#/definitions/fields" |
|
59 | 59 | }, |
60 | 60 | { |
61 | 61 | "$ref": "#/definitions/stac_extensions" |
62 | | - } |
63 | | - ], |
64 | | - "anyOf": [ |
| 62 | + }, |
65 | 63 | { |
66 | 64 | "$comment": "Validate fields in Collection Providers.", |
67 | 65 | "type": "object", |
68 | | - "required": [ |
69 | | - "providers" |
70 | | - ], |
71 | 66 | "properties": { |
72 | 67 | "providers": { |
73 | 68 | "type": "array", |
|
95 | 90 | } |
96 | 91 | }, |
97 | 92 | { |
98 | | - "$ref": "#/definitions/require_any_field" |
| 93 | + "$ref": "#/definitions/fields" |
99 | 94 | }, |
100 | 95 | { |
101 | 96 | "$ref": "#/definitions/fields" |
|
116 | 111 | { |
117 | 112 | "type": "object", |
118 | 113 | "$comment": "This validates the fields in Collection Assets, but does not require them.", |
119 | | - "required": [ |
120 | | - "assets" |
121 | | - ], |
122 | 114 | "properties": { |
123 | 115 | "assets": { |
124 | 116 | "type": "object", |
125 | | - "not": { |
126 | | - "additionalProperties": { |
127 | | - "not": { |
128 | | - "allOf": [ |
129 | | - { |
130 | | - "$ref": "#/definitions/require_any_field" |
131 | | - }, |
132 | | - { |
133 | | - "$ref": "#/definitions/fields" |
134 | | - } |
135 | | - ] |
| 117 | + "additionalProperties": { |
| 118 | + "allOf": [ |
| 119 | + { |
| 120 | + "$ref": "#/definitions/fields" |
| 121 | + }, |
| 122 | + { |
| 123 | + "$ref": "#/definitions/fields" |
136 | 124 | } |
137 | | - } |
| 125 | + ] |
138 | 126 | } |
139 | 127 | } |
140 | 128 | } |
141 | 129 | }, |
142 | 130 | { |
143 | 131 | "type": "object", |
144 | 132 | "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", |
145 | | - "required": [ |
146 | | - "item_assets" |
147 | | - ], |
148 | 133 | "properties": { |
149 | 134 | "item_assets": { |
150 | 135 | "type": "object", |
151 | | - "not": { |
152 | | - "additionalProperties": { |
153 | | - "not": { |
154 | | - "allOf": [ |
155 | | - { |
156 | | - "$ref": "#/definitions/require_any_field" |
157 | | - }, |
158 | | - { |
159 | | - "$ref": "#/definitions/fields" |
160 | | - } |
161 | | - ] |
| 136 | + "additionalProperties": { |
| 137 | + "allOf": [ |
| 138 | + { |
| 139 | + "$ref": "#/definitions/fields" |
| 140 | + }, |
| 141 | + { |
| 142 | + "$ref": "#/definitions/fields" |
162 | 143 | } |
163 | | - } |
| 144 | + ] |
164 | 145 | } |
165 | 146 | } |
166 | 147 | } |
167 | 148 | }, |
168 | 149 | { |
169 | 150 | "type": "object", |
170 | 151 | "$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.", |
171 | | - "required": [ |
172 | | - "summaries" |
173 | | - ], |
174 | 152 | "properties": { |
175 | 153 | "summaries": { |
176 | | - "$ref": "#/definitions/require_any_field" |
| 154 | + "type": "object", |
| 155 | + "properties": { |
| 156 | + "processing:expression": { |
| 157 | + "type": "array", |
| 158 | + "items": { |
| 159 | + "$ref": "#/definitions/fields/properties/processing:expression" |
| 160 | + }, |
| 161 | + "minItems": 1 |
| 162 | + } |
| 163 | + } |
177 | 164 | } |
178 | 165 | } |
179 | 166 | } |
|
195 | 182 | } |
196 | 183 | } |
197 | 184 | }, |
198 | | - "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 | | - "anyOf": [ |
201 | | - {"type": "object", "required": ["processing:expression"]}, |
202 | | - {"type": "object", "required": ["processing:lineage"]}, |
203 | | - {"type": "object", "required": ["processing:level"]}, |
204 | | - {"type": "object", "required": ["processing:facility"]}, |
205 | | - {"type": "object", "required": ["processing:software"]} |
206 | | - ] |
207 | | - }, |
208 | 185 | "fields": { |
209 | 186 | "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", |
210 | 187 | "type": "object", |
|
0 commit comments