Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow strings to be null for backward compat on recent bugfix #450

Merged
merged 1 commit into from
May 10, 2024

Conversation

1000TurquoisePogs
Copy link
Member

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.

Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Copy link
Contributor

@JoeNemo JoeNemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@1000TurquoisePogs 1000TurquoisePogs merged commit 099a869 into v2.x/rc May 10, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants