💻 Tech
I just learned something new in YAML as I was modifying an API doc. These are two of the special scalar types for string in YAML:
- Literal block scalar: uses
|
to preserve newlines and spaces.description: | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
- Folded block scalar: uses
>
to convert newlines into spaces and to preserve paragraph breaks.description: > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.