Open bertrandmarc opened 3 years ago
Great, thanks for the report.
It's interesting: from that page, it looks like the web service API and URL scheme are those of SDMX 2.0. So it's just that query parameter which allows retrieving messages in SDMX-ML 2.1. I haven't seen a hybrid like that before.
The way to handle this is to set the modify_request_args()
hook on a source-specific class. For an example see https://github.com/khaeru/sdmx/blob/30d8145022ce4837fa426055b1039ec8b9910895/sdmx/source/ilo.py#L7-L24
@bertrandmarc on another look, I am not sure if these pages are current.
https://sdmxcentral.imf.org/ws/public/sdmxapi/rest/
.https://sdmxcentral.imf.org/ws/public/sdmxapi/rest/data/CPI/CPI..PCPI_2009_IX.
, produces a response with an error message (e.g. in this case "Not enough key values in query, expecting 5 got 4"). I have tried a little to construct a working data query to add to the test suite, but haven't been able to.It's entirely possible that IMF is operating two services. Maybe one is a legacy one that will eventually be retired, and the other is a modern one. It's also possible the documentation has not been kept up to date (there are no dates mentioned on the pages you linked).
If this is an important data source, would you mind to get in touch with them to ask what the situation is? Better than trying to guess.
It seems the url for IMF changed. It is now possible to get data from IMF in SDMX 2.0, 2.1 and JSON. SDMX XML: http://datahelp.imf.org/knowledgebase/articles/1952905-sdmx-2-0-and-sdmx-2-1-restful-web-service SDMX JSON: http://datahelp.imf.org/knowledgebase/articles/667681-using-json-restful-web-service
Unfortunately, to get SDMX XML 2.1 data, one needs to add a parameter format=sdmx-2.1 to all requests, and I don't know how to add that in the sources list.