I propose to extend the OperationMessage by a code attribute that is set to the ValidationError.code if a ValidationError was raised.
Feature Request Type
[x] Alteration (enhancement/optimization) of existing feature(s)
Description
The Django ValidationError has a code attribute which can be set on initialization. This feature is already used by Django internally and part of the official API for most validators.
Our use-case: For a project with optional client-side localization we want to provide predictable error codes that can be translated by the client without parsing the human-friendly message string. I'm sure there are other use-cases as well.
I can work on a pull request for this in case you are interested!
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
I propose to extend the
OperationMessage
by acode
attribute that is set to theValidationError.code
if aValidationError
was raised.Feature Request Type
Description
The Django
ValidationError
has acode
attribute which can be set on initialization. This feature is already used by Django internally and part of the official API for most validators.Our use-case: For a project with optional client-side localization we want to provide predictable error codes that can be translated by the client without parsing the human-friendly message string. I'm sure there are other use-cases as well.
I can work on a pull request for this in case you are interested!
Upvote & Fund