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

Resolve enum refs in URL schemas #95

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Conversation

piercefreeman
Copy link
Owner

@piercefreeman piercefreeman commented Apr 16, 2024

Users sometimes want to set up a controller that will respond to multiple URL paths (/abc/item_details and def/item_details for instance). This PR adds support for including enum definitions within URL paths. We will parse these as expected at call-time and include the enum typehints within the links controller.

class ItemType(StrEnum):
    A = "A"
    B = "B"

class MyController(ControllerBase):
    url = "/{item_type}/{item_id}"

@piercefreeman piercefreeman merged commit ecf8756 into main Apr 16, 2024
14 checks passed
@piercefreeman piercefreeman deleted the feature/fix-ref-in-schemas branch April 16, 2024 23:40
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.

1 participant