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

[feature] Allow templates in .Schemes(...) #624

Closed
fenollp opened this issue Apr 8, 2021 · 3 comments
Closed

[feature] Allow templates in .Schemes(...) #624

fenollp opened this issue Apr 8, 2021 · 3 comments

Comments

@fenollp
Copy link

fenollp commented Apr 8, 2021

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is - e.g. "I'm always frustrated when [...]"

I maintain an OpenAPI lib which provides a Mux router. The OpenAPIv3 spec allows variables in the scheme part of the URL but today .Schemes(...) do not support templating.

Describe the solution you'd like

What would the feature look like? How would it work? How would it change the API?

For Router and Router: I'd like Schemes() to accept a template with zero or more scheme variables enclosed by {}. Variable names shall be unique in a given route. They should be retrieved calling mux.Vars(request). Basically .Host() templating behavior but for schemes.

Describe alternatives you've considered

Are there alternatives you've tried, and/or workarounds in-place?

We have a workaround in place at getkin/kin-openapi#337 but it doesn't allow retrieving the values of variables defined for the scheme.

fenollp added a commit to fenollp/kin-openapi that referenced this issue Apr 8, 2021
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.

@stale stale bot added the stale label Jun 26, 2021
@fenollp
Copy link
Author

fenollp commented Jun 26, 2021

@elithrar can you please take a look?

@stale stale bot removed the stale label Jun 26, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.

@stale stale bot added the stale label Jan 9, 2022
@stale stale bot closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant