manosim / manosim/django-rest-framework-docs

wrong doc generated when using ModelViewSets

Open
#88 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
641
Forks
178
PR merge metrics
No merged PRs in 30d

Description

When using ModelViewSets, the apis shown in doc are wrong.

``` python
class UserInfoSerializer(ModelSerializer):
class Meta:
model = User

class UserInfo(ModelViewSet):
queryset = User.objects.all()
serializer_class = UserInfoSerializer

urlpatterns = [
url(r'^docs/', include('rest_framework_docs.urls')),
]

urlpatterns += router.urls
```

The results in `/docs/` are

```
/docs/users/ OPTIONS
/docs/users// OPTIONS
```

Is this a already known bug?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ModelViewSet example and inspect how the documentation generator derives endpoints from router URLs. Compare the generated /docs/ entries with the routes exposed by the viewset; done means the documentation lists the correct ModelViewSet operations instead of only OPTIONS endpoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.