Skip to content

Sparse fields set should only drop fields when rendering #1216

Closed
@sliverc

Description

@sliverc

Description of the Bug Report

As discussed in #1214 there is an issue with SparseFieldsetsMixin serializer mixin. It drops fields when reading and writing, however it should only do it when reading and not when writing as per specification.

When analyzing the code, it seems the best to implement is to move the exclude logic from __init__ and overwrite _readable_fields.

Related to #1053

Checklist

  • Certain that this is a bug (if unsure or you have a question use discussions instead)
  • Code snippet or unit test added to reproduce bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions