From d0ccd7c8c8ced1ea3a2ff6434b4f6b4c97af9cc7 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Tue, 23 May 2023 15:36:12 +1000 Subject: [PATCH] Added docs on yes/no being strings in yaml spec 1.2 --- operators/boolean-operators.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/operators/boolean-operators.md b/operators/boolean-operators.md index c409445a..887817d7 100644 --- a/operators/boolean-operators.md +++ b/operators/boolean-operators.md @@ -26,6 +26,24 @@ will output true ``` +## "yes" and "no" are strings +In the yaml 1.2 standard, support for yes/no as booleans was dropped - they are now considered strings. See '10.2.1.2. Boolean' in https://yaml.org/spec/1.2.2/ + +Given a sample.yml file of: +```yaml +- yes +- no +``` +then +```bash +yq '.[] | tag' sample.yml +``` +will output +```yaml +!!str +!!str +``` + ## `and` example Running ```bash