@@ -1204,28 +1204,48 @@ def get_oas_30(cfg: dict, locale: str) -> tuple[list[dict[str, str]], dict[str,
12041204 }
12051205 }
12061206
1207+ # TODO: update feature POSTs once updated in OGC API - Features
1208+ # https://github.com/opengeospatial/ogcapi-features/issues/771
1209+ paths [items_path ]['post' ] = {
1210+ 'summary' : f'Get { title } items with CQL2' ,
1211+ 'description' : description ,
1212+ 'tags' : [k ],
1213+ 'operationId' : f'getCQL2{ k .capitalize ()} Features' ,
1214+ 'requestBody' : {
1215+ 'description' : 'Get items with CQL2' ,
1216+ 'content' : {
1217+ 'application/json' : { # CQL2
1218+ 'schema' : {
1219+ '$ref' : OPENAPI_YAML ['cql2' ]
1220+ }
1221+ }
1222+ },
1223+ 'required' : True
1224+ },
1225+ 'responses' : {
1226+ '200' : {'$ref' : f"{ OPENAPI_YAML ['oapif-1' ]} #/components/responses/Features" }, # noqa
1227+ '400' : {'$ref' : f"{ OPENAPI_YAML ['oapif-1' ]} #/components/responses/InvalidParameter" }, # noqa
1228+ '500' : {'$ref' : f"{ OPENAPI_YAML ['oapif-1' ]} #/components/responses/ServerError" } # noqa
1229+ }
1230+ }
1231+
12071232 if p .editable :
12081233 LOGGER .debug ('Provider is editable; adding post' )
12091234
1210- paths [items_path ]['post' ] = {
1211- 'summary' : f'Add { title } items' ,
1212- 'description' : description ,
1213- 'tags' : [k ],
1214- 'operationId' : f'add{ k .capitalize ()} Features' ,
1215- 'requestBody' : {
1216- 'description' : 'Adds item to collection' ,
1217- 'content' : {
1218- 'application/geo+json' : {
1219- 'schema' : {}
1220- }
1221- },
1222- 'required' : True
1223- },
1224- 'responses' : {
1225- '201' : {'description' : 'Successful creation' },
1226- '400' : {'$ref' : f"{ OPENAPI_YAML ['oapif-1' ]} #/components/responses/InvalidParameter" }, # noqa
1227- '500' : {'$ref' : f"{ OPENAPI_YAML ['oapif-1' ]} #/components/responses/ServerError" } # noqa
1228- }
1235+ paths [items_path ]['post' ]['operationId' ] = f'getCQL2OrAdd{ k .capitalize ()} Features' # noqa
1236+
1237+ val = paths [items_path ]['post' ]['summary' ]
1238+ paths [items_path ]['post' ]['summary' ] = f'{ val } or add item (see media type)' # noqa
1239+
1240+ val = paths [items_path ]['post' ]['requestBody' ]['description' ]
1241+ paths [items_path ]['post' ]['requestBody' ]['description' ] = f'{ val } or add item to collection' # noqa
1242+
1243+ paths [items_path ]['post' ]['requestBody' ]['content' ]['application/geo+json' ] = { # noqa
1244+ 'schema' : {}
1245+ }
1246+
1247+ paths [items_path ]['post' ]['responses' ]['201' ] = {
1248+ 'description' : 'Successful creation'
12291249 }
12301250
12311251 try :
0 commit comments