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

Fix operation paths #45

Merged
merged 1 commit into from
Aug 8, 2018
Merged

Fix operation paths #45

merged 1 commit into from
Aug 8, 2018

Conversation

tetafro
Copy link
Collaborator

@tetafro tetafro commented Aug 7, 2018

I've got a problem with basePath in spec. I need it to be empty (or /). If I delete it from spec file, the program fails with this

panic: chi: routing pattern must begin with '/' in ''

goroutine 1 [running]:
go.fasten.cloud/geo/explorer/vendor/github.com/go-chi/chi.(*Mux).handle(0xc42027e000, 0x8, 0x0, 0x0, 0xbeffa0, 0xc4200aa038, 0xc420f9d5f0)
	/home/dkrivak/Dev/projects/go/src/go.fasten.cloud/geo/explorer/vendor/github.com/go-chi/chi/mux.go:375 +0x2a4
go.fasten.cloud/geo/explorer/vendor/github.com/go-chi/chi.(*Mux).Method(0xc42027e000, 0xb63ff4, 0x3, 0x0, 0x0, 0xbeffa0, 0xc4200aa038)
	/home/dkrivak/Dev/projects/go/src/go.fasten.cloud/geo/explorer/vendor/github.com/go-chi/chi/mux.go:117 +0xb3
go.fasten.cloud/geo/explorer/vendor/github.com/hypnoglow/oas2.chiRouter.Route(0xc00020, 0xc42027e000, 0xb63ff4, 0x3, 0x0, 0x0, 0xbeffa0, 0xc4200aa038)
	/home/dkrivak/Dev/projects/go/src/go.fasten.cloud/geo/explorer/vendor/github.com/hypnoglow/oas2/router_adapter.go:23 +0x70
go.fasten.cloud/geo/explorer/vendor/github.com/hypnoglow/oas2.NewRouter(0xc4200aa018, 0xc420f9dc50, 0xc420f9dc80, 0x6, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/dkrivak/Dev/projects/go/src/go.fasten.cloud/geo/explorer/vendor/github.com/hypnoglow/oas2/router.go:60 +0x1be
...

And when basePath: /, then I get double slashes in paths

DEBU[0000] oas: handle DELETE //cities/{id}              channel=oas
DEBU[0000] oas: handle DELETE //locations/{id}           channel=oas
DEBU[0000] oas: handle DELETE //streets/{id}             channel=oas
...

@hypnoglow hypnoglow merged commit b52667f into master Aug 8, 2018
@hypnoglow hypnoglow deleted the base-path branch October 4, 2018 22:34
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

Successfully merging this pull request may close these issues.

2 participants