'Return a list of `coreapi.Field` instances corresponding to any
request body input, as determined by the serializer class.'

def get_serializer_fields(self, path, method, view):

    if (method not in ('PUT', 'PATCH', 'POST')):
        return []
    if (not hasattr(view, 'get_serializer')):
        return []
    serializer = view.get_serializer()
    if isinstance(serializer, serializers.ListSerializer):
        return [coreapi.Field(name='data', location='body', required=True, schema=coreschema.Array())]
    if (not isinstance(serializer, serializers.Serializer)):
        return []
    fields = []
    for field in serializer.fields.values():
        if (field.read_only or isinstance(field, serializers.HiddenField)):
            continue
        required = (field.required and (method != 'PATCH'))
        field = coreapi.Field(name=field.field_name, location='form', required=required, schema=field_to_schema(field))
        fields.append(field)
    return fields
