-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Milestone
Description
Checklist
- I have verified that that issue exists against the
master
branch of Django REST framework. - I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- This is not a usage question. (Those should be directed to the discussion group instead.)
- This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case.
- I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
If you have two end points:
/self
supporting [DELETE, GET, PUT]
and /version/self
supporting [GET, PUT]
both will have same category self
. Thus when schema is generated the GET
and PUT
methods from 1st end point will be overwritten and the schema will only show DELETE
as accepted method for that endpoint
Expected behavior
Methods should not be overwritten.
Work Around
I have edited https://github.com/tomchristie/django-rest-framework/blob/d0ed482d7094e94b8cbfdc6c0f8335e02d79b765/rest_framework/schemas.py#L108 portion with this for now so it would behave as expected
for category, action, link in links:
if category is None:
content[action] = link
elif link.url in content:
content[link.url][action] = link
else:
content[link.url] = {action: link}