How to get swagger-ui to show the request headers sent?

2,445 views
Skip to first unread message

Rory

unread,
Mar 27, 2015, 10:32:06 AM3/27/15
to swagger-sw...@googlegroups.com

When using swagger-ui, after sending a request through using the 'Try it out!' button, the following sections are shown:

  • Request URL
  • Response Body
  • Response Code
  • Response Headers

Is there any way to get swagger-ui to display more details about the request, such as a 'Request Headers' section?

I'm using swagger v1.2.0.

Note, cross-posted on stackoverflow: 

http://stackoverflow.com/questions/29299853/how-to-get-swagger-ui-to-show-the-request-headers-sent

Tony Tam

unread,
Mar 27, 2015, 11:10:09 AM3/27/15
to swagger-sw...@googlegroups.com
Do you really want people potentially seeing passwords or other sensitive info in the headers?  It's technically easy but was intentionally left out. 


--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rory

unread,
Mar 27, 2015, 11:33:07 AM3/27/15
to swagger-sw...@googlegroups.com
For my particular use case, yeah I would like users to be able to see request headers.

I'm guessing I need to modify the swagger-ui.js file to add a section for the request headers? 

I've had a look and can get the request body, path, and method easy enough, but can't seem to find where to get the request headers in this file, can you point me in the right direction?

Many thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

tony tam

unread,
Mar 27, 2015, 11:35:22 AM3/27/15
to swagger-sw...@googlegroups.com
Got it.  Then in this case, please open a ticket on swagger-ui and we should turn that into a configuration when initializing swagger-ui.

When you say you're using swagger v.1.2.0 do you mean that's the version of your swagger spec?  Or the UI?

Ron Ratovsky

unread,
Mar 27, 2015, 11:36:13 AM3/27/15
to swagger-sw...@googlegroups.com
There is a ticket, no need to open a new one.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

Rory

unread,
Mar 27, 2015, 11:54:38 AM3/27/15
to swagger-sw...@googlegroups.com
Thanks, found the ticke https://github.com/swagger-api/swagger-ui/issues/693.

Just of interest, I'm already using a customized swagger-ui.js, is it possible to get the request headers in this file? Thanks,
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ron Ratovsky

unread,
Mar 27, 2015, 12:43:14 PM3/27/15
to swagger-sw...@googlegroups.com
The answer is here.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages