-
Notifications
You must be signed in to change notification settings - Fork 128
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
@BasePath appears to be non-optional #95
Comments
Yeah I'm wondering the same thing about the documentation :D |
Ah, I think I see the issue. I was under the impression that basePath defaulted to "{{.}}" for both General API info and Sub API Definitions, but it looks like it actually defaulted to not including a basePath for General API info and "{{.}}" for Sub API Definitions only. /*****************************************
* i.e. old default (go format):
*****************************************/
var resourceListingJson = `{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"apis": [...]
}`
var apiDescriptionsJson = map[string]string{"user":`{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "{{.}}",
"resourcePath": "/user",
"apis": [...]
}`
/*****************************************
* i.e. new default (go format):
*****************************************/
var resourceListingJson = `{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "{{.}}",
"apis": [...]
}`
var apiDescriptionsJson = map[string]string{"user":`{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "{{.}}",
"resourcePath": "/user",
"apis": [...]
}` Is it preferred for the General API info basePath to default to not being included or default to "{{.}}"? I don't have a strong preference either way. If nothing else, we can return to it defaulting to not being listed, so as to not break existing functionality in some cases. Thanks! |
Submitted pull request #96 to default to old behavior. Let me know if it fixes your issue. Thanks! |
Doesn't fix it unfortunately. Error is still the same:
|
@boonep @mixedCase |
It sounds like it's not working for @mixedCase. I'm not exactly sure the expected functionality, or where the error is arising, so I'm not sure I can be much more help. Might make sense to just revert 3430d5b since it appears to be breaking some use cases, and isn't providing critical functionality. |
#96 did not fix it for me. At the moment I'm just working around the issue by specifying |
@mixedCase if you pull commit 20e8232 is the error gone? Thanks! |
Yes, indeed that commit does fix it!. Sorry for replying 5 days late. |
I agree with this hugely @boonep 👍 |
Today I updated swagger and this is still not working without specifying @basepath I'm afraid. |
This commit: 3430d5b introduced adding @basepath as a requirement for the swagger page to work properly, or at least that's the only thing that unbreaks my workflow.
Despite not seeing the benefit in this, I don't mind it, but I haven't seen it documented anywhere.
Is this intended behavior?, and if so, can it get a mention in the wiki? Thanks.
The text was updated successfully, but these errors were encountered: