data-validator icon indicating copy to clipboard operation
data-validator copied to clipboard

Unknown fields in the check section of `.yaml` should cause `WARN` log messages.

Open dougb opened this issue 6 years ago • 0 comments

While testing stringLengthCheck I accidently referenced minLength instead of minValue This caused configTest() to fail for no apparent reason and took me a really long time to debug because the program was not logging any useful information. configTest() did generate a ValidatorError() event in the eventLog, but the program doesn't write the report.json or HTML report on configTest() failures.

The new Object.fromJson() constructors should log a warn for every unknown field present in the config. In general, I do not think that unknown fields should be an error, only a warning, this helps keeps the config "compatible" across versions. Maybe create a cli option for strict config parsing.

dougb avatar Jun 27 '19 14:06 dougb