YAML supports single line comments.
# This is a single line commentYAML does not support multi line comments. But, if you want to provide comments for multiple lines, you can use single line comments in this way:
# This is a comment line 1
# This is a comment line 2
# This is a comment line 3Features of Comments
- A commented block is skipped during execution.
- Comments help to add a description to specified block of code.
- Comments must not appear inside scalars.
- YAML does not provide any way to escape the hash symbol (
#) a within multiline string, so there is no way to divide the comment from the raw value of the string.
For example, comments within a collection are made in this way:
key: #comment 1
- value 1
- value 2
- value line 3