Pitfall of a different validation strategy #508
abelsiqueira
started this conversation in
Ideas
Replies: 1 comment
-
I have created a proof of concept: #517 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was thinking about the validation and errorMessages and wondered if you have considered the following alternate strategy for
getMyErrors
.getMyErrors
should receive a object with optional fieldsinstancePath
,schemaPath
andparams
.errors
array for complete match of present fields.getMyErrors({ params: { missingProperty: 'title' } })
should get themissing title
error.getMyNewErrors({ schemaPath: `#/definitions/${props.type}/pattern` })
should get the identifier errorThis approach appears more straightforward to understand, in my opinion, because it's more direct on what constitutes a match.
Possible pitfalls:
type
errors can be ignored because they are usually superseded by pattern errors (I think).instancePath
,schemaPath
andparams
.Beta Was this translation helpful? Give feedback.
All reactions