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

swagger_doc.json returns wrong swagger doc urls #150

Closed
orbanbotond opened this issue Sep 11, 2014 · 11 comments
Closed

swagger_doc.json returns wrong swagger doc urls #150

orbanbotond opened this issue Sep 11, 2014 · 11 comments

Comments

@orbanbotond
Copy link

See the description here:

http://stackoverflow.com/questions/25772229/swagger-doc-json-returns-wrong-swagger-doc-urls/25782328#25782328

It seems that since the version 0.7.2 the url_base get lost...

#0.7.2
:path => "#{url_base}/#{local_route}#{url_format}",

#0.8
path: "/#{local_route}#{url_format}",
@dblock
Copy link
Member

dblock commented Sep 11, 2014

I think this was done on purpose because there's a separate basePath returned and Swagger-UI combines those values. Do you set that globally? Does swagger UI render actually wrong URLs?

@orbanbotond
Copy link
Author

I tried to set base_path without any effect... should I try basePath?

According to the doc it is base_path

@dblock
Copy link
Member

dblock commented Sep 11, 2014

The doc should be correct. It's possible that this is a bug of course, maybe you can try to build a simple repro case, I would start by looking at tests inside this gem, maybe add one.

@TrevTheDev
Copy link

+1 for me: in my case ignoring the base_path means that my two swagger endpoints no longer work.

@davidmccoy
Copy link
Contributor

Same here. I can't get grape-swagger to pay attention to any base_path values.

@dblock
Copy link
Member

dblock commented Dec 14, 2014

I believe this may be fixed by https://github.com/tim-vandecasteele/grape-swagger/pull/167, can someone please do me a favor and verify it?

@tomafc330
Copy link

@dblock checked out latest from master d33fb9d and still didn't work. workaround for now is to revert back to 0.7.2

@dblock
Copy link
Member

dblock commented Dec 19, 2014

@tommytcchan Help me reproduce this in a spec in this project?

@boomshadow
Copy link

I'm using ReDoc to view Swagger output. It was continually showing my endpoints as:

http://127.0.0.1:9292undefined/v1/list

The only way to fix this was to specifically define the base_path, even though I'm not adding it:

add_swagger_documentation \
    base_path: '/',
    add_base_path: false

@LeFnord
Copy link
Member

LeFnord commented Sep 5, 2016

@boomshadow … which version of grape-swagger you are using?
this is an issue of the old one, but the add_base_path assumes you are using > 0.21.x,
can you clarify it, and if it is version > 0.21.x, can you open an issue, thanks

@boomshadow
Copy link

@LeFnord ah, I missed that this was for the older version. Yes, I'm using 0.23.0. I'll open a new issue. Thanks for that.

@LeFnord LeFnord closed this as completed Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants