Skip to content
uencoder

YAML Schema

A YAML schema defines the type-resolution rules for scalar nodes, e.g., the JSON Schema (strict JSON types) and the Core Schema (flexible inference).

Purpose

To control how YAML scalars map to types, avoiding ambiguity from implicit type inference (e.g., yes as bool vs string).

Mechanism

Core Schema (default): unquoted scalars are inferred as int/float/bool/null/str by regex. JSON Schema: strictly JSON types, where only quoted strings are str. Failsafe Schema: everything is str.

Use cases

  • Strict YAML typing
  • Configuration validation
  • Avoiding implicit inference

Related tools

References