Changes between Version 2 and Version 3 of Ticket #33780
- Timestamp:
- Jun 13, 2022, 4:56:51 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33780
- Property Triage Stage Accepted → Unreviewed
- Property Version dev → 4.0
- Property Component Uncategorized → Core (URLs)
- Property Resolution → duplicate
- Property Status new → closed
- Property Summary FEATURE: add http method argument to the URLResolver → Add http method argument to the URLResolver
-
Ticket #33780 – Description
v2 v3 10 10 I think, the motivation is clear: the endpoint is actually path + http method. If we look at the swagger page of any API, that becomes clear. In the REST specification, for example, listing the items and creating new item have the same URL. Semantically - quite different things. 11 11 12 Other frameworks, like Sanic or FastAPI, already support direct routing by http method (you can decorate the view with @app.get(your_url) ). So does Pyramid.12 Other frameworks, like Sanic or FastAPI, already support direct routing by http method (you can decorate the view with @app.get(your_url), so does Pyramid). 13 13 14 14 Moreover, in the mixed wsgi + asgi application, I might want to make creating an item an async view (because the user should be notified about this event), and showing the list of item - a regular sync view. I am not able to do this currently. … … 28 28 In the end, I want to stress that there is NO DOWNSIDE of this whatsoever. It's not hard to make resolver.resolve(path) behave as it used to, when the method is not specified. All classes / instances remain the same so there will be no problems with third-party libs like rest_framework, swagger generators or others. 29 29 30 Personally I am ready to contribute to this feature. 30 Personally I am ready to contribute to this feature.