-
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(validation): add validation schema for rich text nodes #152
Conversation
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
- Coverage 88.44% 79.37% -9.08%
==========================================
Files 80 80
Lines 2060 2148 +88
Branches 229 242 +13
==========================================
- Hits 1822 1705 -117
- Misses 194 361 +167
- Partials 44 82 +38
Continue to review full report at Codecov.
|
@@ -31,6 +31,32 @@ const assetImageDimensions = validation('assetImageDimensions', Joi.object({ | |||
|
|||
const assetFileSize = validation('assetFileSize', range('number')) | |||
|
|||
const nodes = validation('nodes', Joi.object({ | |||
'embedded-entry-block': Joi.array(), |
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.
here decided to be very general, although AFAIK these are the possible validations in this case:
(object with size
and message
, object with linkContentType
and message
{"nodes": {
"embedded-entry-inline": [
{
"size": {
"min": 10,
"max": 20
},
"message": "this is a custom error for number of embedded inline entries"
},
{
"linkContentType": [
"parent"
],
"message": "we only accept parent"
}
]
}
do you think I should go one level deeper with possible validations here?
a22f4c2
to
32a725a
Compare
🎉 This PR is included in version 0.15.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.