With grape >= 0.12.0, support for notes
is replaced by passing a block detail
option specified. For future compatibility, update your code:
desc 'Get all kittens!', notes: 'this will expose all the kittens'
to
desc 'Get all kittens!' do
detail 'this will expose all the kittens'
end
Be aware of ruby-grape/grape#920, currently grape accepts either an option hash OR a block for desc
.
If you're using grape-swagger-rails, remove the .json
extension from GrapeSwaggerRails.options.url
.
For example, change
GrapeSwaggerRails.options.url = '/api/v1/swagger_doc.json'
to
GrapeSwaggerRails.options.url = '/api/v1/swagger_doc'
See #187 for more information.
If your API uses Grape 0.10.0 or newer with a single format :json
directive, add hide_format: true
to add_swagger_documentation
. Otherwise nested routes will render with .json
links to your API documentation, which will fail with a 404 Not Found.
The following options have been added, removed or have been changed in the grape-swagger interface:
markdown: true/false
=>markdown: GrapeSwagger::Markdown::KramdownAdapter
You can now configure a markdown adapter. This was originally changed because of performance issues with Kramdown and the markdown
option no longer takes a boolean argument. Built-in adapters include Kramdown and Redcarpet.
To configure the markdown with Kramdown, add the kramdown gem to your Gemfile:
gem 'kramdown'
Configure grape-swagger as follows:
add_swagger_documentation (
markdown: GrapeSwagger::Markdown::KramdownAdapter
)
To configure markdown with Redcarpet, add the redcarpet and the rouge gem to your Gemfile. Note that Redcarpet does not work with JRuby.
gem 'redcarpet'
gem 'rouge'
Configure grape-swagger as follows:
add_swagger_documentation (
markdown: GrapeSwagger::Markdown::RedcarpetAdapter
)
See #142 and documentation section Markdown in Notes for more information.