Error messages from DX field validation could be better (ConstraintNotStatisfied)
Open
Nobody has claimed this yet.
01 type: bug
- Dominant language
- Python
- Stars
- 109
- Forks
- 107
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 4
Description
The error messages like
Module plone.restapi.deserializer.dxcontent, line 129, in __call__
zExceptions.BadRequest: [{'message': 'Constraint not satisfied', 'field': 'gl_date', 'error': ConstraintNotSatisfied('', 'gl_date')}]
are pretty generic and not very helpful for an API consumer. The reason for such an error could be that the related field is either required or the value for the value does not match the vocabulary values of a configured vocabulary.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at plone.restapi.deserializer.dxcontent.call around line 129 and trace how ConstraintNotSatisfied becomes the API response. Compare the required-field and configured-vocabulary validation paths. Done means API consumers receive messages that distinguish missing required values from values outside a vocabulary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100