Closed mounirmesselmeni closed 2 years ago
On first sight the resolution mechanics look ok. We do have a couple of tests that cover rest_framework_nested
: https://github.com/tfranzel/drf-spectacular/blob/master/tests/contrib/test_drf_nested_routers.py
could you try and build a minimal reproduction? otherwise it will be very hard resolving this.
closing this stale issue for now. feel free to comment if anything is missing or not working and we will follow-up.
but what is it then? are there warning emitted to the console? spectacular should default to
str
if nothing can be resolved. so i'm assuming some field (of typeinteger
) got found there. we would need a reproduction to further investigate.that is the default regex for all of DRF's path parameters. if spectacular sees that, it tries to be smarter and find a field type for that name
custom_id
.for further discussion please open a new issue.
Originally posted by @tfranzel in https://github.com/tfranzel/drf-spectacular/issues/453#issuecomment-1063351328
The field is of type string and named
api_id
. It's basically a UUID with a string prefix.The weird behavior for me is that Im getting this problen only for nested viewsets, for the other ones it's in fact defaulting to string (using the same field name but on a different model)
There are also no warnings during schema generation with drf spectacular