Basic
key: value
Yaml will auto detect data type, but some time that’s what we don’t want. So you need Type cast :
1 | age: !!str 10 |
- type avaliable
- str
- int
- float
- bool
- null
- ISO date type:
2020-1-1 11:11:22
- array
Array
Can not use TAB in yaml. Use indentation to grading and -
char to sign as a array.
1 | arr: |
Object
Can not use TAB in yaml. Use indentation to grading but no -
char.
1 | person: |
Long string value
1 | message: |
To end with \n
1 | message: > |
To end with \n
for each line
1 | message: | |
Use Reference
Assign with pointer
1 | father: |
New part
Yaml not allow you have dulplicate key. You can use ---
to statement in a new part
1 | name: ring |
End of File
You can use ...
to tell yaml, this is the end.