-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Schema generation doesn't work if URL ends with method name #4704
Comments
Any chance you could include the traceback of that exception? |
Oh, yeah, sorry for that. I've updated report. |
hello @tomchristie any idea when this will be solved? |
Not yet. Been focusing on functionality for 3.6 lately. |
This also happens if an url is (or maybe also ends with? did not try this one) 'list' (a natural verb enough). The reason is that |
It also occurs when you use drf-extensions with NestedRoutes. |
Is it possible to have this resolved in the next patch release? |
This issue is caused by usage of
|
You can temporary fix it in your project using a custom |
@carltongibson is it possible to get this fixed in 3.7.0? |
😀 that's the idea. I need to look into exactly what the issue is, and then the fix, but it's on the short list |
I opened #5464 with test cases for this. Can I ask all interested to review to see that your case is covered? @mlubimow I covered your original case. I also added the viewset case from the Stack Overflow issue. (@ola-t I wasn't entirely sure your case with @everyone: Are you seeing a case that's a bit different? I'll take PRs on https://github.com/carltongibson/django-rest-framework on the Please don't be shy — if your case isn't covered it won't be fixed for v3.7! |
Hey @carltongibson, I think my case may not be covered, as I've got a problem when URL contained http method name in path (like get/post/delete etc). For example: Thanks for fixing that issue! 👍 |
@mlubimow Can you then try and replicate the issue in a test case? Why? Because this does not
That means there's info missing from your description. I'm happy to fix it, but I need the reproduce... 👍 (PR to my fork on 37/schema-naming-collisions branch) |
@carltongibson I tried to reproduce it on your branch but I can't - I'm not sure if its because of a different way of getting the list of endpoints (as in my MVP attached to the issue endpoints are read from settings using EndpointInspector) or it has been fixed since then (when I created a ticket PIP version of DRF was 3.5.3). Installing new version of DRF in my MVP yields another error.. |
@carltongibson thanks! |
* Add failing tests for #4704 * Add generic view based test case. * Adjust insert_into to raise ValueError
Steps to reproduce
If one would use urls like these (not a good practice but possible):
Schema generation using rest_framework.schemas.get_schema_view will fail.
I've attached minimal test django project if anyone would like to reproduce the issue.
Expected behavior
Schema should be generated as normally does.
Actual behavior
Throws an exception:
The text was updated successfully, but these errors were encountered: