Skip to content

Avoid overwriting of pointer when using custom errors #399

Closed
@brettdh

Description

@brettdh

The code that produces JSON:API error objects assumes that all fields being validated are under /data/attributes:

def format_drf_errors(response, context, exc):

and there doesn't appear to be a way to override the pointer value when specifying the field on a serializer.

Use case: I would like to be able to specify a serializer for the top-level "meta" field and have any validation errors on that data generate responses properly populated with "source": {"pointer": "/meta/foo"}.

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