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

Allow escaped : char in route path #1987

Closed
aldas opened this issue Sep 16, 2021 Discussed in #1986 · 0 comments · Fixed by #1988
Closed

Allow escaped : char in route path #1987

aldas opened this issue Sep 16, 2021 Discussed in #1986 · 0 comments · Fixed by #1988

Comments

@aldas
Copy link
Contributor

aldas commented Sep 16, 2021

Discussed in #1986

Originally posted by morilog September 16, 2021
Can I able to escape : char in route path to achieve compatiblity with google API design custom methods? something like fiber framework

For example in https://service.name/v1/some/resource/name:customVerb, the :customVerb is not route parameter and only is a simple string.

// curl -v -X POST "http://localhost:8088/v1/some/resource/name:undelete"
func main() {
	e := echo.New()

	// route path as Cloud API "custom method"
	// https://cloud.google.com/apis/design/custom_methods
	e.POST("/v1/some/resource/name\\:undelete", func(c echo.Context) error {
		resp := fmt.Sprintf("mehtod: %v\n", c.Request().Method)
		return c.String(200, resp)
	})
	log.Fatal(e.Start(":8088"))
}
aldas added a commit that referenced this issue Sep 19, 2021
…hods" https://cloud.google.com/apis/design/custom_methods can be implemented (resolves #1987) (#1988)

Allow escaping of colon in route path so Google Cloud API "custom methods" https://cloud.google.com/apis/design/custom_methods could be implemented (resolves #1987)
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 a pull request may close this issue.

1 participant