Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers & Non-2XX status Codes #13

Open
dbushong opened this issue Dec 16, 2019 · 0 comments
Open

Headers & Non-2XX status Codes #13

dbushong opened this issue Dec 16, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@dbushong
Copy link
Member

Some REST APIs like to respond with non-2XX status codes, and sometimes they have important details you need in the response headers (two separate issues, but related when you get 30X + Location header, e.g.)

Proposal:

  1. For all properties in the responses object in a swagger operation entry, set min/maxStatusCode properties in the fetch to support them; this is gofer-specific behavior, and overly broad, but should be an adequate workaround for now
  2. For all responses that have defined response headers, make the headers, conforming to their defined schemae, available in one enclosing response dictionary-style object, keyed by the lowercase header names, under...some unique version of the word "headers"(?)

e.g.:

paths:
  '/go/{id}':
    get:
      responses:
        301:
          description: redirect to page for id
          headers:
            Location:
              type: string
              format: uri

and then in your GraphQL query you should be able to ask for { headers { location } } - the only question is how to choose the name headers so it doesn't conflict with something in the body schema, potentially.

@dbushong dbushong added the enhancement New feature or request label Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant