Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Avoid overwriting of pointer when using custom errors #399

Closed
Labels
@brettdh

Description

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

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /