Uploaded image for project: 'edge-patron'
  1. edge-patron
  2. EDGPATRON-28

edge-patron | Honor the Accept header

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Template:
    • Sprint:
      Q4 scope
    • Development Team:
      Gulfstream

      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

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                cmcnally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases