Replies: 2 comments
-
|
(I'm aware I've been making a bunch of posts here recently, so thanks for your responses so far. I'm very happy to contribute PRs for anything you consider worthy of inclusion, FWIW. ❤️ ) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@way-dave well... you can make you class inherited from Router and then overwite the add_api_operation method class MyPathView(PathView):
...
class MyRouter(Router):
def add_api_operation(...):
...
if path not in self.path_operations:
path_view = MyPathView()
self.path_operations[path] = path_view
else:
...
...
router = MyRouter()
@router.post(.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Right now,
PathViewis an internal implementation detail. However, have some use-cases that would benefit from a blessed way to use our ownPathViewsubclass.This is analogous to the existing ability to use a custom
Routersubclass.It would then be very useful to be able to customize the
PathView._find_operation, allowing custom dispatch logic to be implemented.Our specific use-case is header-based API versioning, which would require dispatch based on a HTTP header as well as method and path.
Beta Was this translation helpful? Give feedback.
All reactions