Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support namespace description in swagger doc #94

Closed
wants to merge 2 commits into from

Conversation

renier
Copy link
Contributor

@renier renier commented Mar 21, 2014

Grape does not support attaching a description to a Namespace. It always flows to the next Route. So when Grape-Swagger rolls the routes up and groups them per path (i.e. namespace), there is no description to attach to the overall namespace.

This pull request allows you to say:

namespace :hello, desc: "Group of APIs to say hello" do
  ...
end

namespace is an alias for other methods like resource and group in Grape.

The generated swagger doc json will then contain the namespace description, and the swagger-ui will naturally add it to the api heading.

@renier
Copy link
Contributor Author

renier commented Mar 30, 2014

screen_shot_2014-03-30_at_8_56_30_am
An example. Adding this namespace description from grape-->grape-swagger is not possible as-is, however it is allowed in the swagger spec. This is what the pull-request enables.

@dblock
Copy link
Member

dblock commented Jul 14, 2014

Merged via tim-vandecasteele@df82041. Please do re-review, there were some changes, notably around the default description value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants