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

Request Headers could be displayed when you "Try it out!" #693

Closed
ecourreges-orange opened this issue Oct 28, 2014 · 5 comments
Closed

Request Headers could be displayed when you "Try it out!" #693

ecourreges-orange opened this issue Oct 28, 2014 · 5 comments

Comments

@ecourreges-orange
Copy link

When you click "Try it out!",
Everything from the request/response is there and displayed nicely in the UI except for the Request Headers which are necessary for some APIs.
As such you are forced to use firebug or wireshark on the side to get them.

@fehguy
Copy link
Contributor

fehguy commented Oct 28, 2014

The request headers are easily available in swagger ui. Would be helpful if you put a screenshot or mock of what you're suggesting.

@ecourreges-orange
Copy link
Author

When you click try it out, you get:

Request URL

http://host:80/url?querystring

Response Body

{
  "error": {
    "code": 13,
    "message": "Invalid Credential Value",
    "description": "A credential value given by the client does not conform to the validation function of this credential type"
  }
}

Response Code

400

Response Headers

{
  "Date": "Tue, 28 Oct 2014 18:31:00 GMT",
  "Server": "Apache",
  "X-Pns-Request-Id": "PNSWS31-27410428",
  "Content-Length": "203",
  "Content-Type": "application/json; charset=\"utf-8\"",
  "Connection": "keep-alive"
}

So the only obviously missing section is "Request Headers", which could be placed right after Request URL and look like this:

Request Headers
{
  "User-Agent": "Your Browser",
  "X-USER-ID": "PNSWS31-27410428",
  "X-Another-Header": "another value",
  "Accept": "application/json; charset=\"utf-8\"",
  "Connection": "keep-alive"
}

There could also be an option in your swagger json description to decide if you want request headers to appear or not, which is something that I haven't found.

@webron
Copy link
Contributor

webron commented Oct 28, 2014

I think this is similar to #273.

@fehguy
Copy link
Contributor

fehguy commented Dec 29, 2014

This should be a configuration. I don't think you always want request headers to be shown, as they can have api keys, passwords, etc.

@fehguy fehguy added this to the future milestone Dec 29, 2014
@webron webron added the P3 label May 4, 2015
@webron
Copy link
Contributor

webron commented Jun 4, 2015

Fix is merged in develop_2.0.

@webron webron closed this as completed Jun 4, 2015
Jonahss pushed a commit to eaze/swagger-ui that referenced this issue Aug 12, 2016
vincent-zurczak pushed a commit to roboconf/swagger-ui that referenced this issue Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants