How do I add comments to a YAML webform?
Context

Drupal 8.x
Webform module
YAML comments

Use-case

developer KoenC wishes to add comments to a YAML file and have those comments retained upon save

Problem

Per the YAML specification, comments are specified as &quot;throwaway&quot; artifacts.
This means that YAML commments are not required to be preserved by parsers that implement the YAML specification

Workaround

Metadata and comments can be added as separate YAML nodes (see e.g., https://stackoverflow.com/a/8565238/42223)