-
Bug
-
Resolution: Obsolete
-
Minor
-
None
-
SaaS
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Engineering
-
Workaround Exists
-
-
This is related to THREESCALE-4938.
This is a minor issue with the links entry when the JSON API returns resources. Usually you can find there a set of related resources links, but the links provided do not use the .json extension (nor any other). Calling those endpoints results in XML being returned, and passing in the header Accept: application/json does not have any effect.
Here's an example request returning links to related resources:
curl -s -H "Accept: application/json" "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508/metrics.json?access_token=<TOKEN>"
{ "metrics": [ { "metric": { "id": 2555418218053, "name": "hits", "system_name": "hits", "friendly_name": "Hits", "description": "Number of API hits", "unit": "hit", "created_at": "2019-03-31T01:33:10Z", "updated_at": "2019-03-31T01:33:10Z", "links": [ { "rel": "service", "href": "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508" }, { "rel": "self", "href": "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508/metrics/2555418218053" } ] } }, ] }
Calling either the service or the self related endpoints results always in XML output no matter what you use as Accept header, as if the .xml extension was used (this is minor, and methinks this can be handled automatically by Rails, but endpoints that cannot return the acceptable format should be returning 406 Not Acceptable).
The quick fix appears easy: add the .json extension to the related links.
- is related to
-
THREESCALE-2137 Unify output format of API calls in "3scale API Documentation"
- Closed
- relates to
-
THREESCALE-5691 Review xml vs. json parameters in "3scale API Documentation"
- To Develop
-
THREESCALE-5715 Bring JSON API to level of XML API and possibly obsolete XML
- Closed