I used to specify the parameters using YAML Docstring, but they have now been deprecated. I have tried using coreapi.Field, as follows:
coreapi.Field(
name='id',
type='integer',
required=True,
location='query'
)
but it only works withViewSet.list, and not with, say, ViewSet.create. According to this report, this has been an on-going issue. The solution provided in the comments are quite hackish to me. I hope someone has already found (or came up with) a neater solution or alternative, perhaps a plugin or something.