Fixes API Blueprint route's always grouping #400
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While using the API Blueprint formatter, I discovered that this gem will always group your endpoint documentation by route no matter what. This isn't always desirable as some users may want to have a bit more control over how these requests are grouped in documentation.
I attempted to write specs:
as
But the test suite will fail with
--format RspecApiDocumentation::ApiFormatter
format because noroute_uri
is set.I would think that these requests would only be grouped together when they are in the same
route
block but that is not the case. I attempted to adjust functionality to work like that but didn't get very far.How would you feel about a change like this??? If you want multiple endpoint groupped together they must all have the same route_uri, route_optionals, and route_name?
This means that you can group endpoints as follows
This will put the
get
call into it's own "Read Resource" group and thepatch
/delete
calls into their own "Modify Resource" group.Another options would be to set something like a "route id" or some kind of unique identifier on the example options somewhere around here.
Thoughts? I have no issue updating documentation once we agree on an approach.