Skip to content

using yq

Note

There are two different YAML processors named yq, one by Andrey Kislyuk that functions as a jq wrapper, and one by Mike Farah that is separate from jq.

Andrey Kislyuk's yq

Although YAML supports comments1, JSON does not support comments2, and jq mostly does not know how to handle comments3 4, so any YAML comments will not be preserved when using Andrey Kislyuk's yq.


  1. https://yaml.org/spec/1.2/spec.html#comment// 

  2. https://stackoverflow.com/questions/244777/can-comments-be-used-in-json/244858#244858 

  3. https://github.com/stedolan/jq/issues/402 

  4. https://github.com/stedolan/jq/wiki/FAQ#processing-not-quite-valid-json