-
Notifications
You must be signed in to change notification settings - Fork 270
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
Custom django path's param convert type feature #502
Comments
hi! drf-spectacular/drf_spectacular/types.py Line 104 in 1407059
however this is an interesting feature request. parsing the type hint is likely too limiting and introducing a new decorator only for this purpose would probably be overkill. either a new setting or adding a schema attr on the converter. unsure atm what the cleanest solution is. |
I will try solve this solution and make PR. |
hey @jtamm-red, thank you for the PR. i decided to go a slightly different route as outlined in my comment. the new approach has a bit more flexibility and does not encourage using i solved this as part of a bigger refactoring, so it was easier to rewrite it myself. thank you however for the pointers and input! the new config is called |
closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up. |
Custom param convert is very useful. Example it is possible to convert from string to date.
I tried to use decorator
extend_schema_field
. It is not working.I received warning log:
could not derive type of path parameter "value" because because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:value>) or annotating the parameter type with @extend_schema. Defaulting to "string".
The text was updated successfully, but these errors were encountered: