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

include_route using api version #61

Closed
lcsvcn opened this issue Mar 5, 2024 · 1 comment
Closed

include_route using api version #61

lcsvcn opened this issue Mar 5, 2024 · 1 comment

Comments

@lcsvcn
Copy link

lcsvcn commented Mar 5, 2024

Is it possible to do something like this?

@api_version(1, remove_in_major=2)
app.include_router(
    user_v1_route, prefix="/user", tags=["user"]
)

@api_version(2)
app.include_router(
    user_v2_route, prefix="/user", tags=["user"]
)
@alexschimpf
Copy link
Owner

This seems pretty similar to the other issue you opened: #51

As for this specific question... decorators can only be applied to function or class definitions. So this would not work in Python.

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

No branches or pull requests

2 participants