-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yaml
334 lines (334 loc) · 12.8 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
openapi: 3.0.1
info:
title: The SpatioTemporal Asset Catalog API - Transaction
version: 1.0.0-rc.2
description: >-
This is an OpenAPI definition of the SpatioTemporal Asset Catalog API Transaction
specification.
contact:
name: STAC Specification
url: "http://stacspec.org"
license:
name: Apache License 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0"
tags:
- name: Transaction
description: >-
STAC-specific operations to add, remove, and edit items within OGC API - Features
collections.
paths:
"/collections/{collectionId}/items":
parameters:
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/collectionId"
post:
summary: add a new STAC Item or Items in an ItemCollection to a collection
description: create a new STAC Item r Items in an ItemCollection in a specific collection
operationId: postFeature
tags:
- Transaction
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/postOrPutItemCollection"
- $ref: "#/components/schemas/postOrPutItem"
responses:
"201":
description: Status of the create request.
headers:
Location:
description: The URL of the newly added resource (i.e. path of the resource end point)
schema:
type: string
format: url
ETag:
schema:
type: string
description: A string to ensure the item has not been modified
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/item"
"202":
description: The item was accepted for asynchronous action
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/NotFound"
"500":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
default:
description: An error occurred.
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"
"/collections/{collectionId}/items/{featureId}":
parameters:
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/collectionId"
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/featureId"
get:
tags:
- Transaction
description: |-
Fetch the feature with id `featureId` in the feature collection
with id `collectionId`.
operationId: getFeature
responses:
"200":
description: Adds a ETag header to the response specified in STAC API - Features
headers:
ETag:
schema:
type: string
description: A string to ensure the item has not been modified
put:
summary: update an existing feature by Id with a complete item definition
description: >-
Use this method to update an existing feature. Requires the entire
GeoJSON description be submitted.
operationId: updateFeature
tags:
- Transaction
parameters:
- $ref: "#/components/parameters/IfMatch"
requestBody:
description: The request body must contain a representation of the replacement item.
content:
application/json:
schema:
$ref: "#/components/schemas/postOrPutItem"
responses:
"200":
description: The item was replaced
headers:
ETag:
schema:
type: string
description: An updated string to track changes
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/item"
"202":
description: The item was accepted for asynchronous action
"204":
description: The item was replaced
headers:
ETag:
schema:
type: string
description: An updated string to track changes
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/NotFound"
"412":
$ref: "#/components/responses/PreconditionFailed"
"500":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
default:
description: An error occurred.
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"
patch:
summary: update an existing feature by Id with a partial item definition
description: >-
Use this method to update an existing feature. Requires a GeoJSON
fragment (containing the fields to be updated) be submitted.
operationId: patchFeature
tags:
- Transaction
parameters:
- $ref: "#/components/parameters/IfMatchOptional"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/patchItem"
responses:
"200":
description: The item was replaced
headers:
ETag:
schema:
type: string
description: An updated string to track changes
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/item"
"202":
description: The item was accepted for asynchronous action
"204":
description: Status of the update request.
headers:
ETag:
schema:
type: string
description: A string to ensure the item has not been modified
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/NotFound"
"500":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
default:
description: An error occurred.
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"
delete:
summary: delete an existing feature by Id
description: Use this method to delete an existing feature.
operationId: deleteFeature
tags:
- Transaction
parameters:
- $ref: "#/components/parameters/IfMatch"
responses:
"200":
description: The resource was deleted.
"202":
description: The operation was accepted for asynchronous executiona.
"204":
description: The resource was deleted.
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/NotFound"
"500":
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
default:
description: An error occurred.
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"
components:
parameters:
IfMatch:
name: If-Match
in: header
description: >-
Only take the action if the ETag of the item still matches
required: true
schema:
type: string
IfMatchOptional:
name: If-Match
in: header
description: >-
Only take the action if the ETag of the item still matches
required: false
schema:
type: string
schemas:
patchItem:
description: >-
An object that contains at least a subset of the fields for a STAC Item.
type: object
properties:
stac_version:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/stac_version"
stac_extensions:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/stac_extensions"
id:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/itemId"
bbox:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/bbox"
geometry:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/geometryGeoJSON"
type:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/itemType"
properties:
$ref: "#/components/schemas/patchItemProperties"
links:
type: array
items:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/link"
assets:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/assets"
patchItemProperties:
description: >-
An object that contains at least a subset of a valid STAC Item Properties object.
type: object
additionalProperties: true
properties:
datetime:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/datetime"
postOrPutItemCollection:
description: >-
A GeoJSON FeatureCollection augmented with foreign members that contain values relevant to a STAC entity
type: object
required:
- features
- type
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
$ref: "#/components/schemas/postOrPutItem"
links:
description: >-
An array of links. Can be used for pagination, e.g. by providing a link
with the `next` relation type.
type: array
items:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/link"
example:
- rel: next
href: >-
http://api.cool-sat.com/search?next=ANsXtp9mrqN0yrKWhf-y2PUpHRLQb1GT-mtxNcXou8TwkXhi1Jbk
postOrPutItem:
description: >-
An object that is a valid GeoJSON Feature, but not necessarily a valid STAC Item.
type: object
required:
- stac_version
- id
- type
- geometry
- properties
properties:
stac_version:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/stac_version"
stac_extensions:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/stac_extensions"
id:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/itemId"
bbox:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/bbox"
geometry:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/geometryGeoJSON"
type:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/itemType"
properties:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/properties"
links:
type: array
items:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/link"
assets:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/assets"
responses:
BadRequest:
description: The request was malformed or semantically invalid
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"
PreconditionFailed:
description: Some condition specified by the request could not be met in the server
content:
application/json:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/exception"