README.markdown in grape-swagger-0.2.1 vs README.markdown in grape-swagger-0.3.0
- old
+ new
@@ -39,9 +39,30 @@
You can pass a hash with some configuration possibilities to ```add_swagger_documentation```, all of these are optional:
* ```:mount_path``` The path were the API documentation is loaded, default '/swagger_doc'
* ```:api_version``` Version of the API that's being exposed
* ```:base_path``` Basepath of the API that's being exposed
* ```:markdown``` Allow markdown in `notes`, default `false`
+* ```:hide_documentation_path``` Don't show the '/swagger_doc' path in the generated swagger documentation
+
+## Swagger Header Parameters
+
+Swagger also supports the documentation of parameters passed in the header. Since grape's ```params[]``` doesn't return header parameters we can
+to specify header parameters seperately in a block after the description.
+
+``` ruby
+desc "Return super-secret information", {
+ headers: {
+ "XAuthToken" => {
+ description: "Valdates your identity",
+ required: true
+ },
+ "XOptionalHeader" => {
+ description: "Not reallly needed",
+ required: false
+ }
+ }
+}
+```
## Swagger additions
grape-swagger allows you to add an explanation in markdown in the notes field. Which would result in proper formatted markdown in Swagger UI. The default Swagger UI doesn't allow HTML in the notes field, so you need to use an adapted version of Swagger UI (you can find one at https://github.com/tim-vandecasteele/swagger-ui/tree/vasco).
We're using [kramdown](http://kramdown.rubyforge.org) for parsing the markdown, specific syntax can be found [here](http://kramdown.rubyforge.org/syntax.html).