Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sinatra build REST API documentation [closed]

I have been looking all night for a gem to generate an API documentation from my sinatra routes. I should be able to specify with inline comments.

I have found https://rubygems.org/gems/sinatra-api-docs & https://rubygems.org/gems/sinatra-croon

but both just don't seem to work with my setup and are outdated too..

The other option was yard with some sinatra plugin, but that does not generate REST API specific layout when generating the docs.

Does anyone have any tools they know about?

All the information i want to reference for each route:

Object: Groups

Route: POST /create

Params: Name of the group

Output:

{
  "name": "group",
  "members": []
}

thanks

like image 492
Max Avatar asked Mar 09 '13 05:03

Max


2 Answers

I would check out Apiary.io, it looks pretty well designed and uses a Markdown-style domain-specific language to describe your API. Plus its free while still in beta.

like image 51
Stuart M Avatar answered Oct 17 '22 09:10

Stuart M


Have you tried Sinatra Yard? I've used it, with some modifications to Yard, to produce my API docs.

like image 37
ian Avatar answered Oct 17 '22 08:10

ian