Better unknown handling configuration #2743
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2739
Status: Draft
This is still a draft as I haven't been able to dedicate the time required to fix up the tests. I'm open to someone else helping out and/or providing guidance. 😄
This PR aims to have better handling of unknown keys. Within the
validate
configuration, instead of just aboolean
,allowUnknown
supports clearer definitions with backwards compatibility:These means we can either allow unknown keys with
allowed
ortrue
, reject withforbidden
orfalse
, or warn withwarn
. Ifwarn
orforbidden
are set, we can set what type the warning or error object are by setting thetype
property.