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
The examples in the docs about validation in mappers are not correct - at least, exceptions are raised when calling e.g.
put_invalidin the way that is is shown in the docs.It is not clear what the
errorsparameter forput_invalidshould 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