Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Scalars

Direct answer

YAML scalars are single values — strings, numbers, booleans, null. Quote strings like "yes", "no", "on" or version numbers such as "1.10", which YAML may otherwise turn into booleans or floats.

When to use this

Use this when YAML values are misinterpreted.

First 30 seconds

1. Scalars: strings, numbers, booleans, null, dates.

2. YAML 1.1 parsers treat yes/no/on/off as booleans.

3. Leading zeros may be octal.

4. Quote when in doubt.

5. Multi-line with | or >.

Operational verification

scalar text → resolved type

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
YAML 1.2 data representation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformYAML 1.2 data representation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when YAML values are misinterpreted.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as encoding/BOM issues, delimiter/quoting ambiguity, duplicate keys, namespace drift, scalar coercion, invalid schema assumptions and parser success without consumer-valid semantics, choosing the cases most relevant to plain/single/double quoted scalar forms, tags/types, null/boolean/number ambiguity and preserving intended strings through parser/consumer layers.

Step 2 Common mistakes Narrow the fault
  • Unquoted no, on, yes becoming booleans in YAML 1.1 parsers.
  • Leading zeros (0755) parsed as octal.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Unquoted yes, no and on may become booleans.
  • 1.10 may become the number 1.1.
  • Quote strings that look like other types.
Key checks
  • yq '.value | tag' file.yaml — resolved type (!!str, !!int, !!bool)
  • Quote strings like 'no', 'on', '012' — avoid implicit typing
  • yamllint file.yaml — truthy rule
ReferenceWhy it matters1 section · depth on demand

What it is

YAML scalars are strings, numbers, booleans and null; quoting controls the type.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Scalars are single values in YAML: strings, numbers, booleans, null, dates. YAML guesses the type from how a value looks, which is convenient and a common source of bugs.

WrittenYAML 1.1 parsers (e.g. PyYAML) read it as
yes, no, on, offBooleans
010Octal 8
1.10Float 1.1
22:22Sexagesimal number 1342
~ or emptynull
2026-11-05Date

Quote values that must stay strings: versions ("1.10"), country codes ("NO"), MAC-like or time-like values, and leading zeros. Multi-line strings use | (keep line breaks — good for certificates and CLI blocks) or > (fold into one line).

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docYAML 1.2 data representation current

Authoritative/upstream documentation reviewed for bounded claims in YAML > Scalars. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://yaml.org/spec/1.2.2/ · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For plain/single/double quoted scalar forms, tags/types, null/boolean/number ambiguity and preserving intended strings through parser/consumer layers, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?