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

@BasePath appears to be non-optional #95

Open
mixedCase opened this issue Sep 16, 2015 · 12 comments
Open

@BasePath appears to be non-optional #95

mixedCase opened this issue Sep 16, 2015 · 12 comments

Comments

@mixedCase
Copy link

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.

@RobertJGabriel
Copy link
Contributor

Yeah I'm wondering the same thing about the documentation :D
@boonep Could you add something to the wiki :)

@boonep
Copy link
Contributor

boonep commented Sep 17, 2015

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!

@boonep
Copy link
Contributor

boonep commented Sep 17, 2015

Submitted pull request #96 to default to old behavior. Let me know if it fixes your issue. Thanks!

@mixedCase
Copy link
Author

Doesn't fix it unfortunately. Error is still the same:

Unable to read api 'clientes' from path {{.}}/clientes (server returned undefined)

@yvasiyarov
Copy link
Owner

@boonep @mixedCase
Does #96 really works ? Should I merge it ?

@boonep
Copy link
Contributor

boonep commented Sep 23, 2015

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.

@mixedCase
Copy link
Author

#96 did not fix it for me. At the moment I'm just working around the issue by specifying @BasePath.

@boonep
Copy link
Contributor

boonep commented Sep 23, 2015

@mixedCase if you pull commit 20e8232 is the error gone? Thanks!

@mixedCase
Copy link
Author

Yes, indeed that commit does fix it!. Sorry for replying 5 days late.

@boonep
Copy link
Contributor

boonep commented Oct 5, 2015

I think the best course of action would be to revert 3430d5b, and not to commit pull request #96. We can then fix the test, and make sure we're not breaking any backwards compatibility.

@RobertJGabriel
Copy link
Contributor

I agree with this hugely @boonep 👍

@mixedCase
Copy link
Author

Today I updated swagger and this is still not working without specifying @basepath I'm afraid.

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

No branches or pull requests

4 participants