-
Notifications
You must be signed in to change notification settings - Fork 150
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 ContentTransformIntentValidator #165
Conversation
shouldPublish should accept 'preserve' in addition to boolean values
I guess we also need to add this for |
And actually Must have missed this during the review. |
@TimBeyer Also, this makes the content-transform.spec.ts test to fail, because the error message from the validation is now different at
|
@@ -157,7 +157,7 @@ describe('Content transformation', function () { | |||
type: 'contentType/transformEntries' | |||
} | |||
}, | |||
message: '"string" is not a valid type for the content transformation property "shouldPublish". Expected "boolean".', | |||
message: '"undefined" is not a valid type for the content transformation property "shouldPublish". Expected "alternatives".', |
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.
This new error message isn't really useful anymore for people.
Maybe we could figure out in
let expectedType = schema._type |
Joi.alternatives
and figure out the different types that are allowed.Either that, or somehow change the message for the
alternatives
validation so that it doesn't say Expected "alternatives"
.
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.
@TimBeyer error message fixed with tests
👏 |
🎉 This PR is included in version 0.16.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
shouldPublish should accept 'preserve' in addition to boolean values
Description
Add 'preserve' as a valid option to validations for shouldPublish field
Motivation and Context
#143 (comment)