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
Briefly, the case below is failing due to the type of the defaultConfigPath property being incorrect (boolean instead of string).
Expected Result:
I would expect to see an error message along the lines of "'defaultConfigPath' must be a string, not a boolean" in this case. Or at least an error that summarizes the errors for each of the anyOf item failure conditions.
Actual Result:
BAE describes the error for the second anyOf condition, but not the first:
Editorial:
If BAE has to choose just one of many errors passed to it, would it make sense to select error with the deepest schemaPath? Or maybe instancePath? Intuition tells me that the "deeper" an error is within a data structure, the more likely it is to be something the user can meaningfully act upon.
[{// This is the error I would most expect/like to see in this caseinstancePath: '/processor/defaultConfigPath',schemaPath: '#/properties/processor/anyOf/0/properties/defaultConfigPath/type',keyword: 'type',params: {type: 'string'},message: 'must be string'},{// This error, while technically correct, isn't all that relevant since the data doesn't// match any properties in this sub-schemainstancePath: '/processor',schemaPath: '#/properties/processor/anyOf/1/required',keyword: 'required',params: {missingProperty: 'defaultConfigPackageKey'},message: "must have required property 'defaultConfigPackageKey'"},{// This error is least likely to be meaningful. And fixing one of the above errors will fix this error. instancePath: '/processor',schemaPath: '#/properties/processor/anyOf',keyword: 'anyOf',params: {},message: 'must match a schema in anyOf'}]
See minimal, verifiable test case, below.
Briefly, the case below is failing due to the type of the
defaultConfigPath
property being incorrect (boolean
instead ofstring
).Expected Result:
I would expect to see an error message along the lines of "'defaultConfigPath' must be a string, not a boolean" in this case. Or at least an error that summarizes the errors for each of the
anyOf
item failure conditions.Actual Result:
BAE describes the error for the second
anyOf
condition, but not the first:Editorial:
If BAE has to choose just one of many errors passed to it, would it make sense to select error with the deepest
schemaPath
? Or maybeinstancePath
? Intuition tells me that the "deeper" an error is within a data structure, the more likely it is to be something the user can meaningfully act upon.Minimal, stand-alone test case
The text was updated successfully, but these errors were encountered: