yvasiyarov/swagger

the basePath {{.}} not parsed when loading in browser

Opened this issue · 4 comments

When I use the newest version of yvasiyarov/swagger to generate docs.go. i find there is a new key "basePath" and the value is "{{.}}". but unfortunately the {{.}} is not parsed to a right path when the browser do a request. so the result is an error looks like
"Unable to read api 'v2' from path {{.}}/v2 (server returned undefined)"

+1

@martsen @abel-von , after hours of test, the fast way to avoid this trouble is ,just remove the "basePath={{.}}" feild in section "var resourceListingJson" (Notes: "basePath={{.}}" feild in section "var apiDescriptionsJson" should retain) of your docs.go generaterd by swagger ,and rerun the command "go run web.go docs.go". This works for me ,hope that helps you too. any way , hope author will fix it soon...

+1, @xiongtoto0526 your fix works as a stop gap, thanks.

shouldn't this also have a host?