You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We at the stryker mutation testing team have been looking into validation with ajv. We've come to the same conclusion, error messages directly from AJV are not really designed for humans. We're thinking of using better-ajv-errors.
However, we're also thinking of filtering out what I call 'shadowing' errors.
A shadowing error is an error that results logically from another error. Some examples:
[{// This is a useless error for a humankeyword: 'type',dataPath: '.mutator',params: {type: 'string'},// [...]},{// => This is the most specific error. This is for humans!keyword: 'required',dataPath: '.mutator',params: {missingProperty: 'name'},// [...]},{// This is a useless error for a humankeyword: 'oneOf',dataPath: '.mutator',params: {passingSchemas: null},[...]}]
Or:
[{// This is a useless error for a humankeyword: 'type',dataPath: '.logLevel',params: {type: 'string'},// [...]},{// => This is the most specific error. This is for humans!keyword: 'enum',dataPath: '.logLevel',params: {allowedValues: ['info','warn']},// [...]},]
Do you think this filtering is useful for other projects as well? Should it be added to better-ajv-errors? Maybe as an option? Or do you want to keep it separate?
I would be willing to prepare it in a PR if you agree that this is a feature useful for all humans, nut just mutant-killing humans 😉.
The text was updated successfully, but these errors were encountered:
Thanks for the response. It is late, but I don't have any illusion of entitlement, no problem whatsoever 😊
We've implemented the error reporting without better-ajv-errors at the moment, but we're happy to move to better-ajv-errors when this feature is implemented.
Hi there 👋. Awesome repo you've got here!
We at the stryker mutation testing team have been looking into validation with ajv. We've come to the same conclusion, error messages directly from AJV are not really designed for humans. We're thinking of using better-ajv-errors.
However, we're also thinking of filtering out what I call 'shadowing' errors.
A shadowing error is an error that results logically from another error. Some examples:
Or:
A first draft of the filtering is created here:
https://github.com/stryker-mutator/stryker/blob/627d2f7e403042845bcece73c838c9447bbf522c/packages/core/src/config/validationErrors.ts#L55-L74
Do you think this filtering is useful for other projects as well? Should it be added to better-ajv-errors? Maybe as an option? Or do you want to keep it separate?
I would be willing to prepare it in a PR if you agree that this is a feature useful for all humans, nut just mutant-killing humans 😉.
The text was updated successfully, but these errors were encountered: