Skip to content

Conversation

@daniel-shuy
Copy link
Contributor

@daniel-shuy daniel-shuy commented Nov 15, 2023

config-merge uses YAML.stringify() to format the merged output as YAML.

While YAML.stringify() outputs YAML version 1.2 by default (https://eemeli.org/yaml/#document-options), the merged output may be consumed/parsed by other applications that expect YAML version 1.1. This is normally not an issue, except when it comes to yes/no strings. By default, YAML.stringify() formats strings unquoted. YAML version 1.2 parses unquoted yes/no strings as strings, while YAML version 1.1 parses unquoted yes/no strings as true/false booleans (https://eemeli.org/yaml/#version-differences).

An easy solution is to configure YAML.stringify() to double-quote all strings by default, by setting defaultStringType to QUOTE_DOUBLE (https://eemeli.org/yaml/#tostring-options). This will have no impact on YAML version 1.2 parsers, but fixes the issue with YAML version 1.1 parsers when it comes to yes/no strings.

@daniel-shuy
Copy link
Contributor Author

Hi @matthewdevenny, could you help to take a look at this PR? Thanks!

Signed-off-by: Daniel Shuy <daniel_shuy@hotmail.com>
@daniel-shuy
Copy link
Contributor Author

Hi @matthewdevenny, could you help to take a look at this PR? Thanks!

@daniel-shuy
Copy link
Contributor Author

Hi @matthewdevenny, could you help to take a look at this PR?

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.

1 participant