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

Add proper boolean conversion to xml representation #228

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

radeno
Copy link
Contributor

@radeno radeno commented Feb 7, 2024

Currently, boolean values are converted incorrectly. Only true value is converted to 1 which is allowed value. false is converted as an empty attribute, which is incorrect.

Based on https://www.w3.org/TR/xmlschema-2/#boolean

true, false, 1, 0 are allowed values.

We don't want to break previous behavior so that feature can be enabled by option.

@radeno
Copy link
Contributor Author

radeno commented Feb 7, 2024

@SanderMuller you pointed to my previous PR about converting to xsi:nil. What do you think about this change, should we consider it as breaking change or bug fixing?

@SanderMuller
Copy link

@SanderMuller you pointed to my previous PR about converting to xsi:nil. What do you think about this change, should we consider it as breaking change or bug fixing?

Looks good, since it's opt-in it shouldn't be a breaking change

@freekmurze freekmurze merged commit c95fd4d into spatie:main Feb 7, 2024
7 checks passed
@freekmurze
Copy link
Member

Thanks!

@radeno radeno deleted the add-boolean-types-processing branch February 7, 2024 11:46
@radeno
Copy link
Contributor Author

radeno commented Feb 7, 2024

Welcome, it was needed for my requirements anyway :)

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.

3 participants