If you use the Properties UI at all, the YAML will be reformatted.
Here are two relevant topics about this (there may be more):
and