ajv-errors icon indicating copy to clipboard operation
ajv-errors copied to clipboard

Remove certain errors

Open epoberezkin opened this issue 8 years ago • 5 comments

Probably using null as the value of errorMessage

epoberezkin avatar Sep 30 '17 15:09 epoberezkin

Can you give an estimate for the cost of fixing this, or suggest a better JSON validator for use? Email [email protected]. I am getting 209 errors in Ajv. I have a feeling there's only 1 or 2 real errors in the whole bunch. Your approach is WRONG, and higher level errors in the JSON hierarchy (closer to the trunk) should not be reported when there's a lower level error in the hierarchy (farther away from the trunk) that causes the higher level error. The JSON in question has deeply nested repeated structures, so I don't think your approach above will work. I can't suppress error messages at any level. The error messages should not be generated.

coderextreme avatar Apr 16 '18 07:04 coderextreme

To give you an idea of the scope of the problem, I have 41 files to validate, with 2721 keyword errors. So around 65 errors per file. These are files that DO validate with our other schema. We're trying to design an automatically generated schema. However, we have been changing the standard, and we need to catch files out of compliance. There are some important differences, and we added oneOf's to catch files out of compliance, but they aren't in our old schema yet. We would like to move to the new schema.

coderextreme avatar Apr 16 '18 08:04 coderextreme

Your approach will work if it reports errors, but prevents bubbling.

coderextreme avatar Apr 16 '18 08:04 coderextreme

If I could put bubble: false in options that would be great!

coderextreme avatar Apr 16 '18 08:04 coderextreme

Removing the allErrors and verbose options reduced the number of errors 75%. I may be able to deal with that.

coderextreme avatar Apr 16 '18 09:04 coderextreme