Skip to content

Provide a working example for (or document) validation in mappers #80

Description

@m-thielen

The examples in the docs about validation in mappers are not correct - at least, exceptions are raised when calling e.g. put_invalid in the way that is is shown in the docs.
It is not clear what the errors parameter for put_invalid should actually be.

This is the example code I'm referring to:

[...]
         try:
             data >> profile_mapper  # This is shorthand for _patch
         except ValidationError as e:
             errors.update(dict(e))

         if errors:
             return self.patch_invalid(errors)

https://django-nap.readthedocs.io/en/latest/rest/index.html#example-updating-two-objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions