Closed bennettl closed 10 years ago
@bennettl : It's on the README. Have a look:
https://github.com/richhollis/swagger-docs#drying-up-common-documentation
Hi Bennett
If you want to add a header and I've read the spec correctly then in theory you should be able to use the regular param with :header type (not tested):
swagger_api :index do param :header, :some_header, :integer, :optional, "Some header" end
Let me know if this works.
I want to populate the header with a default value, but this doesn't seem to work:
param :header, :some_header, :integer, :optional, "Some header", "Default Value"
What about this (untested):
param :header, :some_header, :integer, :optional, "Some header", {"defaultValue" => "some default"}
@bennettl Did that work?
Yes that did the trick. Thank you so much!
I need all swagger api actions to set a custom header to my server. How do I do this?