Quotes usage for properties

19 views
Skip to first unread message

Daniel Mallorga

unread,
Apr 23, 2025, 3:12:25 PMApr 23
to SnakeYAML
Hi guys,

I was wondering whether it is the same to quote the property keys of a YAML properties file, or are there some specific cases where they should be quoted? I read somewhere, I can't remember now, that if there is a chance of a possible ambiguity, it is recommended to use quotes even for keys. I just wanted to know if, for SnakeYaml, this does it matter or not.

Thanks in advance,
Daniel.

Uday Bhaskar Sarma Seetamraju

unread,
Apr 23, 2025, 5:51:06 PMApr 23
to snakeya...@googlegroups.com
Even when not using SnakeYaml, I’ve used strings containing blanks, ampersand&, exclamation! etc .. within the keys/LHS. 

Which obviously have to be quoted.

Worked great without fail everywhere (AWS, python too)

--
You received this message because you are subscribed to the Google Groups "SnakeYAML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snakeyaml-cor...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/snakeyaml-core/9330e7d3-5a0b-4830-a668-860bf8d4436fn%40googlegroups.com.

Andrey Somov

unread,
Apr 24, 2025, 2:19:39 AMApr 24
to snakeya...@googlegroups.com
normally (when you do not an explicit tag) you use quotes (single or double) to mark a string scalar.
"2", '2" - these are strings
2 - this is a number

Cheers,
Andrey

--
Reply all
Reply to author
Forward
0 new messages