Skip to content

Does DRF support nested writable serializer with multipart/form-data? #7262

@mohmyo

Description

@mohmyo

Checklist

  • I have verified that that issue exists against the master branch of Django REST framework.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • This is not a usage question. (Those should be directed to the discussion group instead.)
  • This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.

Hello,

I'm trying to upload a file with some nested data via POST and content-type:multipart/form-data, no matter how I'm sending the value for the nested field as a text or JSON my serializer always rasing the exception for the nested field as This field is required despite I'm sure it is being correctly mapped to request.data - fields and values are as expected - and passed to the parent serializer, I have even tried to write a parser or to use a package but nothing changes, for some reason the nested field is always dropped at validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions