Yarn contains key and values pairs separated by : and space.
Key is always astring and values can be one of the following types.
datatypes are yaml values that can be assigned to keys.
It contains following datatypes supported
- String
- Number
- Boolean
- Null
- Array
- Map
Yaml Strings
String is a plain string or enclosed in single or double string
quoted string is an optional and can be used if you use unicode or escape characters.
key: value
key1: 'single quote string'
key2: "double quote string"
key3: "must be double quotes for escape characters in a string\n"
Multi Line strings can be represented in two ways
using Multiline Literal Block String
str: |
Single Line 1
Single Line 2
Single Line 3
using Multiline Folded Block String
str: >
Single Line 1
Single Line 2
Single Line 3
Yaml boolean values
boolean values represents true
and false
.
key: true
key: false
key: TRUE
key: FALSE
key: True
key: False
It also accepts english words yes
/no
or on
/off
Yaml Numbers
numbers can be integer or floating numeric value.
# Scalar data types
integerValue: 1 # integer value
octalNumber: 0123 # Octal Numeric vale
hexaNumber: 0x4dea1 # Hexa Decimal Numeric vale
floatingValue: 1 # floating vale