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

Add support for enums in route parameters #60

Closed
wants to merge 1 commit into from

Conversation

kuba-baku
Copy link
Contributor

Add support for enums in route parameters by using Werkzeug's built-in any() converter.
E.g. route

@app.get('/<any("nyse", "nasdaq"):market>/<stock_id>')
async def get_price(market, stock_id):
   """Get stock price"""
   ...

renders as

image

@pgjones
Copy link
Owner

pgjones commented Nov 12, 2023

Thanks, merged manually due to conflicts.

@pgjones pgjones closed this Nov 12, 2023
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