fotinakis / swagger-blocks

Define and serve live-updating Swagger JSON for Ruby apps.
MIT License
621 stars 98 forks source link

Sinatra support and documentation. #117

Open jmolina4 opened 6 years ago

jmolina4 commented 6 years ago

#

PLEASE READ THIS BEFORE FILING AN ISSUE:

https://github.com/fotinakis/swagger-blocks/#filing-issues

# Hi,

In the Readme you say that you support any Ruby framework but there's only documentation for Rails. Is there any documentation example with a Sinatra app?

Thanks,

NickyWeber commented 5 years ago

I am also interested in this!

stefanosx commented 4 years ago

For Sinatra, the configuration is exactly the same. The only thing you need to do is just add the route, like:

  get 'api_docs' do
    json Swagger::Blocks.build_root_json(SWAGGERED_CLASSES)
  end