tomchristie/django-rest-framework — Issue #134: HTTP Method Docstrings
Author: btimby
Created: 2012-01-19 16:20:32+00:00
State: open

This is a feature proposal rather than a bug report.

I think it would be nice if the docstrings on the various HTTP handler methods were displayed in the (X)HTML/TEXT rendered version of an API endpoint. Currently, the view's docstring is converted to HTML via Markdown, then displayed at the top of the endpoint's HTML representation.

I would propose that in addition to this, the docstrings for get, post, put, delete, options etc. are also displayed on this page. Currently there is a section for each method (which displays the resource's form for PUT/POST requests) but no chance to document these methods individually. For example:

```python

MyView(View):
"""This docstring documents the MyView API endpoint.
This is formatted and displayed in a browser."""

def get(self, request):
"""This docstring documents the GET method of the MyView API endpoint.
I would like to see this receive the same treatment."""
```

If this sounds like a useful extension to the self-documenting API feature, let me know and I will send a pull request.