I am trying to set a custom path param product_id.
It seems to only work if url param is already camelCase. is this the expected behavior? this would mean manual mapping in the view from camelCase to snake_case.
custom_urlpatterns = [
# works
path('<int:productId>/sellers/', views.ProductSellerAPIView.as_view(), name='sellers'),
# does NOT work
# path('<int:product_id>/sellers/', views.ProductSellerAPIView.as_view(), name='sellers'),
]
# Combine both sets of URL patterns
urlpatterns = [
path('', include(router.urls)),
] + custom_urlpatterns
with snake_case param, when i post a request from swagger, I get
I can make it work by setting param name = id instead of product_id, but wanted to check just in case the underlying issue might cause any other effects.
actually this might be drf-spectacular failing to play well with this middleware.
I am trying to set a custom path param
product_id
.It seems to only work if url param is already camelCase. is this the expected behavior? this would mean manual mapping in the view from camelCase to snake_case.
with snake_case param, when i post a request from swagger, I get
fails to insert the param.
I can make it work by setting param name =
id
instead ofproduct_id
, but wanted to check just in case the underlying issue might cause any other effects.actually this might be drf-spectacular failing to play well with this middleware.