Closed spidamoo closed 1 year ago
A string with a colon must only by quoted when it's followed by a space (or a linebreak) See also http://blogs.perl.org/users/tinita/2018/03/strings-in-yaml---to-quote-or-not-to-quote.html
When you say it's invalid YAML, do you have problems loading it?
Yup I did a little more research and indeed it does not seem to be invalid YAML per se. The problem I have is I generate OpeanAPI spec and load it into Swagger UI and Swagger does not recognise this example as a string, it says it's an OrderedMap.
The only thing I can think of that Swagger UI sees it as a timestamp instead of an ordinary string. It depends on what YAML types are enabled in the loader. There is currently no way in YAML::XS to quote such strings, but there will be in YAML::PP(::LibYAML), as soon as I support timestamp types.
Closing this as it isn't a bug
I encountered a problem when a string containing colons does not get encoded, e.g.:
Which is invalid YAML. I believe this should be fixed.