@@ -53,6 +53,16 @@ func GetOpenAPIContent(urlBase string) *openapi3.Swagger {
53
53
AllowEmptyValue : false ,
54
54
},
55
55
}
56
+ paramFeatureID := openapi3.ParameterRef {
57
+ Value : & openapi3.Parameter {
58
+ Name : "featureId" ,
59
+ Description : "Id of feature in collection to retrieve data for." ,
60
+ In : "path" ,
61
+ Required : true ,
62
+ Schema : & openapi3.SchemaRef {Value : openapi3 .NewStringSchema ()},
63
+ AllowEmptyValue : false ,
64
+ },
65
+ }
56
66
paramBbox := openapi3.ParameterRef {
57
67
Value : & openapi3.Parameter {
58
68
Name : "bbox" ,
@@ -365,6 +375,36 @@ func GetOpenAPIContent(urlBase string) *openapi3.Swagger {
365
375
},
366
376
},
367
377
},
378
+ Post : & openapi3.Operation {
379
+ OperationID : "createCollectionFeature" ,
380
+ Parameters : openapi3.Parameters {
381
+ & paramCollectionID ,
382
+ & paramFeatureID ,
383
+ // TODO keep it for the next evolution
384
+ // ¶mCrs,
385
+ },
386
+ RequestBody : & openapi3.RequestBodyRef {
387
+ Value : & openapi3.RequestBody {
388
+ Description : "Add a new feature" ,
389
+ Required : true ,
390
+ Content : openapi3 .NewContentWithJSONSchema (& FeatureSchema ),
391
+ },
392
+ },
393
+ Responses : openapi3.Responses {
394
+ "201" : & openapi3.ResponseRef {
395
+ Value : & openapi3.Response {
396
+ Description : "Empty body with location header" ,
397
+ Headers : map [string ]* openapi3.HeaderRef {
398
+ "location" : {
399
+ Value : & openapi3.Header {
400
+ Description : "Contains a link to access to the new feature data" ,
401
+ },
402
+ },
403
+ },
404
+ },
405
+ },
406
+ },
407
+ },
368
408
},
369
409
apiBase + "collections/{collectionId}/schema" : & openapi3.PathItem {
370
410
Summary : "Feature schema for collection" ,
@@ -399,16 +439,7 @@ func GetOpenAPIContent(urlBase string) *openapi3.Swagger {
399
439
OperationID : "getCollectionFeature" ,
400
440
Parameters : openapi3.Parameters {
401
441
& paramCollectionID ,
402
- & openapi3.ParameterRef {
403
- Value : & openapi3.Parameter {
404
- Name : "featureId" ,
405
- Description : "Id of feature in collection to retrieve data for." ,
406
- In : "path" ,
407
- Required : true ,
408
- Schema : & openapi3.SchemaRef {Value : openapi3 .NewStringSchema ()},
409
- AllowEmptyValue : false ,
410
- },
411
- },
442
+ & paramFeatureID ,
412
443
& paramProperties ,
413
444
& paramTransform ,
414
445
& paramCrs ,
0 commit comments