adding support for number and boolean when using custom tag objects#722
Open
chikko80 wants to merge 3 commits intonodeca:masterfrom
Open
adding support for number and boolean when using custom tag objects#722chikko80 wants to merge 3 commits intonodeca:masterfrom
chikko80 wants to merge 3 commits intonodeca:masterfrom
Conversation
th30neee
approved these changes
Nov 30, 2025
th30neee
approved these changes
Nov 30, 2025
th30neee
approved these changes
Nov 30, 2025
scutuatua-crypto
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improve handling of numbers and booleans in custom tags
Description
This PR enhances the YAML dumper to correctly handle numbers and booleans when using custom tags. Previously, these types were being converted to strings prematurely, leading to undesired quoting in the YAML output. The changes ensure that numbers and booleans retain their original type representation in the dumped YAML.
Changes in Output
Before this change, numbers and booleans in custom tags were being quoted in the YAML output:
After this change, the output correctly represents numbers and booleans without quotes:
This improvement allows for more accurate type preservation and easier parsing of the resulting YAML.
Changes
Modified the
writeNodefunction to properly handleNumberandBooleantypes:Added a new test case to verify the correct handling of numbers and booleans with custom tags:
Motivation
This change is necessary to ensure that YAML output accurately represents the original data types when using custom tags. It's particularly important for configurations and data serialization where preserving the exact type of values is crucial.
Testing
A new test case has been added to verify the correct behavior. The test ensures that numbers and booleans are dumped without quotes when using custom tags.
Additional Notes
Please review and let me know if any further changes or clarifications are needed.