Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
jq and yq in Depth: Querying, Transforming and Editing JSON and YAML on the Command Line
jq returns a missing field as null instead of an error and exits with 0 on empty results too; add -e to every filter you use as a condition in CI. With output from Bookstore.Api, kubectl, dotnet list package and the GitHub API we show select, group_by, reduce inputs, --arg/--argjson and @csv, updating an image tag with yq while keeping comments, the two different yq tools and Windows quoting.
YAML 1: Syntax, Types and the "Norway Problem": Reading a YAML File Correctly
The type of an unquoted YAML value depends on the rule set the parser applies: in YAML 1.1 NO is false, 12:30 a number and 0755 octal; in YAML 1.2 all three differ. We run PyYAML, ruamel.yaml, js-yaml, YamlDotNet, yq, Docker Compose and kubectl on the same file and show three real type errors in Bookstore's compose.yaml and Kubernetes manifest.