slate-studio / openapi-rails

OpenAPI-compliant CRUD interface for Rails models with documentation.
http://www.kra.vc/openapi-rails
MIT License
38 stars 12 forks source link

Suggestion for more better workings #10

Open philsturgeon opened 7 years ago

philsturgeon commented 7 years ago

Howdy Alex!

This gem is all over the homepage of Google when you search for "Rails OpenAPI" so good job on that. Sadly, it's not particularly useful (for me, and anyone not using mongoid), and it really could be made substantially more useful with a bit of decoupling.

Let me explain my use case and you see what you think.

I'm tasked with getting a large company all switched onto Open API, from a disparate set of ragtag sources. There were one or two on API Blueprint, and I converted those with APIMatic Transformer. There were some with loads of endpoints at least "bookmarked" in Postman, which was better than nothing.

Now im down to the ones that have nothing.

I was hoping a gem would exist to do any of the folowing:

  1. Pull endpoints out of routes, so at least the endpoints are put into paths
  2. Maybe do a little checking on StrongParams to see what parameters are in there (hard to detect if query or body due to Rails munging them)
  3. Checking on render usage to pull out some json blobs or check AMS for structure

They're written from easy to hard, and importance to pipe dream.

I'd hoped your gem could at least do 1, but for some reason you've tied even that to mongoid, and you need to pass in the controllers you want to document. Surely passing in a namespace should suffice?

Not trying to be an arse, and I could potentially put a little time in to help with this. I'm mostly just curious about the decision, and interested in finding a solution to my quest of getting all APIs documented.