Details
-
Type:
Story
-
Status: Closed (View Workflow)
-
Priority:
P3
-
Resolution: Won't Do
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Template:customfield_11100 36220
-
Sprint:Prokopovych - Sprint 134
-
Development Team:Gulfstream
-
Epic Link:
Description
Overview
Currently the edge patron API always returns JSON. Honoring the accept header for at least application/xml will make it easier for external systems to consume this service.
Really, this means that if the accept header is request application/xml, we convert the json into XML response.
Any other value specified in the accept header would result in JSON, including if the accept header is omitted altogether.
Summarizing:
- If accept header equals '*/*' or 'application/json' or isn't specified, then response returns json
- If accept header equals 'application/xml', then response returns xml
- Inappropriate accept headers (such as image/* or even application/*) should result in HTTP 415 Unsupported Media Type status
Acceptance Criteria
- The service an return either xml or json based upon the request's accept header
- HTTP 415 error is returned in case of inappropriate accept headers specified in request
- Unit tests are updated
- API tests are updated.
Scenarios
1. Scenario – return JSON
- Given request to edge-patron
- When Accept header in request equals / or includes application/json or is empty
- Then response is returned in JSON format
2. Scenario – return XML
- Given request to edge-patron
- When Accept header in request includes application/xml
- And application/json isn’t included in Accept header
- Then response is returned in XML format
3. Scenario – return HTTP 415 status
- Given request to edge-patron
- When Accept header in request doesn’t include application/json or application/xml
- And Accept header doesn’t equal /
- And Accept header isn’t empty
- Then return HTTP 415 error status instead of response
TestRail: Results
Attachments
Issue Links
- clones
-
EDGRTAC-16 Honor the Accept header
-
- Closed
-
- relates to
-
UXPROD-2424 RTAC | Patron empowerment - EDGE-PATRON AND MOD-PATRON API updates
-
- Closed
-