[Feature] Handle Accept header for JSON/XML response in WPS 2.0 #125
Labels
process/wps1
Issue related to WPS 1.x processes support
process/wps2
Issue related to WPS 2.x processes support
process/wps3
Issue related to WPS 3.x (REST-JSON) processes support
Context
Given that WPS 2.0 supports JSON response, we should handle a providedAccept=application/json
header on the WPS route (eg:/ows/wps
by default). By default this route returns XML.Some code to do the detection of WPS version/format was introduced in f0cd31e but is still unused.This is now functional
See returned response (proper OGCAPI - Processes content)
If version is WPS 1.x, the only supported format is XML. This should also be the default return on/ows/wps
route if noversion=...
parameter was provided in the URL.Default behaviour is to provide the corresponding XML into JSON format, regardless of version:
See produced response (JSON PyWPS content)
TODO
/processes
,/processes/{id}
, etc.) to their corresponding WPS 2.0/ows/wps
request if any from (Accept: application/xml
,Accept: text/xml
,f=xml
,format=xml
) is provided (inverse of what is currently functional).Use dict2xml (or similar) to provide an XML body corresponding to the original JSON.
format=
as alias off=
on OWS endpoint.https://github.com/Ouranosinc/Magpie/blob/f67a134d52ec8f3951cb1a08a07c1c5beb518882/magpie/api/generic.py#L106-L202
The text was updated successfully, but these errors were encountered: