Allow strings to be null for backward compat on recent bugfix #450
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.
Prior to v2.16.0 rc1, yaml entries such as
foo:
were wrongly identified as an empty string when yaml spec says these should be null.However, some programs were relying upon this in their schema, and upon us fixing the bug, their schemas became invalid when they strictly checked for type=string, when in reality their config was set up so that type could be either string OR null.
This is a temporary fix which allows the same behavior.
It does so by, upon seeing a null, checking if the schema says it should instead be a string.
If so, it will craft an empty string and do a string validation upon it, because it is still possible the user's schema required a string with size greater than 0.
This behavior is toggled by validator->allowStringToBeNull
I suggest removing it in v3, but keeping it for now to not cause disruption.