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

Documenting API at namespace root #189

Closed
Beans0063 opened this issue Dec 29, 2014 · 6 comments
Closed

Documenting API at namespace root #189

Beans0063 opened this issue Dec 29, 2014 · 6 comments
Labels

Comments

@Beans0063
Copy link

APIs assigned to the root of a namespace seem to be missing from the generated swagger_doc. For example, the api accessible at http://localhost:3000/v1/mailer_templates is missing when I view http://localhost:3000/swagger_doc/mailer_templates:

version 'v1', using: :path
resource :mailer_templates do
 desc "Return list of mailer templates"
 get do
  MailerTemplate.limit(20)
 end
end

Adding a url to route seems to fix this:

get :list do
  MailerTemplate.limit(20)
end

The regex here seems to be excluding the root url. Is this by design, if so how can route of '/' be included in swagger_docs?

Thanks

@dblock
Copy link
Member

dblock commented Dec 29, 2014

I don't think this is by design, would appreciate a spec + fix.

@dblock dblock added the bug? label Dec 29, 2014
@Beans0063
Copy link
Author

I couldn't reproduce my problem in specs, so perhaps it's something specific to my app. I was able to workaround the issue by changing from:

version 'v1', using: :path

to the routing equivalent:

prefix :v1

With this change things are working correctly so I'll close out the issue. Thanks for the help.

@tonycoco
Copy link

@Beans0063 & @dblock I had to dig for an hour for this... can we reopen this so it is surfaced as a bug and fixed?

@dblock
Copy link
Member

dblock commented Feb 12, 2015

@tonycoco
Copy link

Nope, @dblock, I referenced that after I found that issue too

@dblock
Copy link
Member

dblock commented Feb 13, 2015

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

No branches or pull requests

3 participants