Yaml received, are there any problems with storing certain types of characters in Yamla?

I am very new to yaml and I just want to know what I can and cannot store a character in yaml?

What are the escape characters for double quotes, etc.

Can I omit multiple lines?

+4
source share
1 answer

Basically, you can store everything. Quotations are not a problem, you can enter text without quotes (and for non-printable characters that you cannot include by accident, there are regular escape sequences). This means that purely numeric text is considered a number, but again, you can add quotation marks or an explicit type annotation (and I assume most libraries do this when necessary), for example. !!str 100 . Also, if you want to include the comment sign ( # ), you need to add quotation marks.

Another problem is that some lines may look like more complex YAMLs (for example, some uses of exclamation points look like casts, and some uses of colons look like singleton associative tables). They can be avoided by using "multi-line" lines, which consist of only one line. Multiline lines exist and are presented in two versions, preserving line breaks ( --- | ) and ignoring new lines, with the exception of empty lines ( --- > , like markdown).

+2
source

Source: https://habr.com/ru/post/1343473/


All Articles