RepreZen / KaiZen-OpenApi-Parser

High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
130 stars 30 forks source link

Create warnings when validators throw exceptions #224

Open andylowry opened 6 years ago

andylowry commented 6 years ago

In its still-being-shaken-out state, validation is more likely than it should be to throw exceptions. Rather than such cases abruptly terminating validation (and failing the overall parse in the default case of validating before the parse completes, it would be better to create a warning for the value being validated, indicating that validation did not complete successfully for that value. It doesn't mean the value is in error, or that it's not. Just that validation shouldn't be trusted for that specific value.

This is in line with the idea that false negatives are worse than false positives for a validator: It's generally better to pass an invalid model than to fail a valid model, since the latter can interrupt processing chains even on perfectly valid input.

OK, maybe at some point that should be an option :). But for now it's our preference.