Skip to content

Add response header OpenAPI spec generation #684

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

Merged
merged 3 commits into from
Jul 19, 2018

Conversation

jdmurphy
Copy link
Contributor

@jdmurphy jdmurphy commented Jul 19, 2018

Add support to expose response headers object

  • Available only with desc DSL block syntax under success and failure keys.
  • Consumer is responsible for documenting headers

@coveralls
Copy link

coveralls commented Jul 19, 2018

Coverage Status

Coverage increased (+0.001%) to 99.529% when pulling 98fcf7b on jdmurphy:response_headers into a73657b on ruby-grape:master.

@LeFnord
Copy link
Member

LeFnord commented Jul 19, 2018

@jdmurphy thanks for it, but I'm a bit confused, your title says something abvout response example, but your code handles headers …

background: there exists a key headers for the describe method, for documenting it
did your change take the same line?

… and sorry, mörged your second PR rivght now

@jdmurphy jdmurphy changed the title Add response example OpenAPI spec generation Add response header OpenAPI spec generation Jul 19, 2018
@jdmurphy
Copy link
Contributor Author

@LeFnord, sorry that was some bad copy/pasting because the feature is similar in scope to @gamartin's addition of response examples.

When I used the headers key in the describe block, it showed up as a parameter and not in the response area. It is possible I was not using it correctly/there was something I missed when I added it; if so please let me know.

@LeFnord
Copy link
Member

LeFnord commented Jul 19, 2018

@jdmurphy … yeap, you are right, success and failures will be used for documenting the response and the headers key as kind as parameter for the request

@LeFnord
Copy link
Member

LeFnord commented Jul 19, 2018

thanks for your contributions @jdmurphy

@LeFnord LeFnord merged commit 642e9e1 into ruby-grape:master Jul 19, 2018
LeFnord pushed a commit to LeFnord/grape-swagger that referenced this pull request Feb 9, 2019
* Add response header OpenAPI spec generation

* Add back "Your change here"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants