goccy / go-yaml

YAML support for the Go language
MIT License
1.12k stars 129 forks source link

Strings looking like dates are marshaled without quotes #430

Open hugosandelius opened 6 months ago

hugosandelius commented 6 months ago

Describe the bug A string looking like a date, e.g. "2023-12-06", is encoded without surrounding quotes. This confuses other YAML parsing libraries which interprets this as a date type (e.g. in Google Cloud APIs).

To Reproduce unmarshal and re-marshal the following: value: "2023-12-06" The quotes will be removed.

Expected behavior Strings looking like dates are always encoded with quotes.

Version Variables