It seems we have started using code as part of validation error in order to:
- make decisions based upon the presence of a specific validation error in the client
- facilitate localization of validation error messages in the client
Is this intended to be the standard approach?
Does the UI currently use some of the existing examples?
If it is intended to be the standard approach, I believe there are some decisions we could need to make.
- Should all validation error messages be expected to have a unique code? (and if so, should this be part of the definition of done for backend stories?
- How should these codes be named?
- Are codes owned by interfaces or implementing modules?
- How do we avoid naming conflicts between modules?
- How does a client know what the set of potential unique errors are?
- If used for localisation, how does a client map parameterised errors to messages?