Always emit numberish strings with quotes

Merged
#30 · Created  · Last updated

Merged pull request

Always emit numberish strings with quotes

8082779·Author: ·Closed by: ·2022-09-20

Description

It is perfectly valid to emit most strings without quotes in YAML 1.1.

For example string 083 can be emitted as 083. Although it starts with a zero, it is not valid octal, and therefore must be a string and can be emitted without quotes.

But a problem will occur if this unquoted 083 is read by some YAML 1.2 parsers, they will read it as integer 83. To appease these parsers, snakeyaml now emits any string that starts with a 0 and looks numberish with quotes.

This means that string 083 will be emitted as '083'.

Addresses #554

0 attachments

0 comments

Loading commits...