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

Header example values #297

Closed
philsturgeon opened this issue Jul 10, 2017 · 4 comments
Closed

Header example values #297

philsturgeon opened this issue Jul 10, 2017 · 4 comments

Comments

@philsturgeon
Copy link
Contributor

philsturgeon commented Jul 10, 2017

Seing as Swagger does not seem to support example values for securityDefinitions, I am defining an exampleToken header parameter and referencing it in every endpoint that requires the token.

parameters:
  exampleToken:
    name: Authorization
    in: header
    required: true
    type: string
    x-example: "Token=exampletoken1"

I'm using that x-example because I'm using Dredd which needs examples for things to work, and ReDoc supports this too - which is handy!

Right now the headers are referenced as existing, but no example shows up:

screen shot 2017-07-10 at 6 30 45 pm

Apiary has a little "Headers" section above the request body:

screen shot 2017-07-10 at 6 36 44 pm

If this could be added to ReDoc, it would be so damn handy!

Ofc for now I've got it hacked into the description, which is fine:

screen shot 2017-07-10 at 6 38 43 pm

@adamaltman
Copy link
Member

Nice idea (and good hack).

@RomanHotsiy
Copy link
Member

@philsturgeon will the following representation work for you:

image

@philsturgeon
Copy link
Contributor Author

This looks great, thank you @RomanGotsiy! Sorry, was in a field for a few days.

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Aug 21, 2017

@philsturgeon great! I will release a new ReDoc version with this feature today!

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