New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix validations for custom field types #8297
Fix validations for custom field types #8297
Conversation
Signed-off-by: Sam Williams <spwilliams91@icloud.com>
7c2f24d
to
92b71d1
Compare
Codecov Report
@@ Coverage Diff @@
## master #8297 +/- ##
=======================================
Coverage 33.04% 33.05%
=======================================
Files 1219 1219
Lines 13573 13576 +3
Branches 1348 1350 +2
=======================================
+ Hits 4485 4487 +2
Misses 8206 8206
- Partials 882 883 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks ! :)
|
||
const input = { uuid: '2479d6d7-2497-478d-8a34-a9e8ce45f8a7' }; | ||
|
||
expect.hasAssertions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #8294
With the new draft/publish system, models with custom field types could no longer be saved.
(Custom field types described here)
When trying to create or update a model with an un-handled attribute type, the API would give a 500 internal server error, as no validator exists for this attribute type.
This PR handles the case where a custom validator is not available for a specific attribute type, and instead of throwing an error, falls back to using a mixed type validator.