-
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
Could not derive type of path parameter "id" but the path fragment is "pk" ? #194
Comments
Hi @eLvErDe, this is a remnant of the base implementation. https://www.django-rest-framework.org/api-guide/settings/#schema_coerce_path_pk typing path params should always work, but due to the however, this is usually not a problem as the type of |
@eLvErDe does this fix work for you? |
@tfranzel Can you wait until thursday ? |
normally yes but the fix is on master and i need to do a fast minor release, due to an unrelated bug in swagger ui. would be much appreciated if you could check it beforehand. |
Ok, give me half an hour |
Yes it works for me, warning is gone, path parameter is typed as integer and API is still working, so I guess your patch is OK, thanks :-) |
thanks so much for doing it so quickly! release will happen very soon. |
Hello,
Could you help me understanding why spectacular says that ?
I have the following code snippets:
But the generated OpenAPI route uses "id" instead of "pk" and keep warning me that type could not be infered (and defaults to string while being actually integer).
Thanks in advance,
The text was updated successfully, but these errors were encountered: