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 documentation #340

Closed
ghost opened this issue Mar 18, 2015 · 4 comments
Closed

Headers documentation #340

ghost opened this issue Mar 18, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 18, 2015

Is it possible to document request headers? And if not, are you are going to implement in future releases (probably in the next one)? Thanks for a great documentation tool, btw.

@mtparet
Copy link
Contributor

mtparet commented Mar 18, 2015

I don't think this is possible for now, I would like to do it too. (In particular for if-match header)

@ghost
Copy link
Author

ghost commented Mar 18, 2015

Basically it's not a problem to implement a DSL for defining request headers like

api :GET, "/users/:id", "Show user profile"
header 'Authentication', String, 'Auth header in format ...'

Is it possible to implement request headers recording during running specs? Any ideas?

@mtparet
Copy link
Contributor

mtparet commented Mar 18, 2015

I think it should be possible, you could look around https://github.com/Apipie/apipie-rails/blob/master/lib/apipie/extractor/recorder.rb#L36

@ghost
Copy link
Author

ghost commented Mar 18, 2015

Well, it looks like the gem can fetch request headers. But how can I filter regular request headers (I mean, standard browser headers) from my API-specific headers?
For example, I have required 'Auth' header in my API. I suppose test_context.request.headers returns all passed headers (like Accept, User-Agent). The gem should detect that only Auth header is required for this particular request. And as I know, Rack automatically converts header's name from to HTTP_AUTH. Any ideas how to accomplish that? Probably some hard-coded list of default Rails headers?

This issue was closed.
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

No branches or pull requests

1 participant