marcgibbons/django-rest-swagger — pull request #20 by lukas-hetzenecker (2013-09-10 19:18:07+00:00)
Title: Docstring keywords: required, body, file, overwrite

The keyword *[body]* marks the parameter type as body. This generates a textarea that is sent as the message body.
The keyword *[required]* marks the query string argument as required.
The keyword *[overwrite]* overwrites all other parameter types - only the one in the docstring are used.

Example usage:
```python
class PlacesPrefetchRequest(APIView):
"""
Returns communities near your location
[overwrite]
Request Body -- Places as JSON [required] [body]
"""

```

I added [file] as a keyword to the docstring, which tells swagger that a multipart file should be uploaded.

```python
class ProfilePictureView(APIView):
"""
Multipart -- Image [required] [file]
"""
parser_classes = (MultiPartParser,)

def put(self, request, *args, **kwargs):
files = request.FILES
print "files", files
return Response({})
```