⚡ OPENDEV HUB V1.0⚡ API STATUS: 100% OPERATIONAL⚡ CLIENT ENGINE: LOADED & CACHED⚡ TRENDING TECH: TAILWIND V4, NEXT.JS 16, RUST, GO⚡ ZERO AUTH REQUIRED
OPENDEVHUB

Command Palette

Search for a command to run...

YAML TOOLKIT

YAML CHEATSHEET & INTERACTIVE GENERATOR

An all-in-one guide and interactive builder for YAML structures. Study syntax specifications, filter options, or configure template variables to generate ready-to-use configs in real-time.

Basic Syntax & Layout5 ENTRIES

Key-Value Pairs (Mappings)Basic Syntax & Layout

The fundamental building block of YAML, mapping an identifier (key) to a value. Must be separated by a colon and a space.

SYNTAX / FORMAT:
key: value
EXAMPLE USECASE:
project_name: OpenDev Hub
version: 1.2.0
status: active
COMMON PITFALL:

Omitting the space after the colon (e.g. 'key:value'). Parsers will treat this as a single string instead of a key-value mapping.

CommentsBasic Syntax & Layout

Inline documentation or notes. The YAML parser ignores anything starting with a hash symbol.

SYNTAX / FORMAT:
# Comment text goes here
EXAMPLE USECASE:
port: 8080 # Run service on port 8080
# Database credentials below:
COMMON PITFALL:

Attempting multi-line block comments using /* ... */ or <!-- ... -->. YAML only supports single-line comments starting with '#'.

Document Separator (Start)Basic Syntax & Layout

Marks the beginning of a new YAML document within a single file or stream, allowing multi-document configurations.

SYNTAX / FORMAT:
---
EXAMPLE USECASE:
---
apiVersion: v1
kind: Pod
metadata:
  name: web-pod
---
apiVersion: v1
kind: Service
metadata:
  name: web-service
COMMON PITFALL:

Placing configurations above the first '---' block, which can cause inconsistent behavior across different parsers.

Document Separator (End)Basic Syntax & Layout

Explicitly marks the end of a YAML document. It is optional but useful for streaming protocols to signal completion.

SYNTAX / FORMAT:
...
EXAMPLE USECASE:
---
message: Hello World
...
# End of document, further text starts a new session
COMMON PITFALL:

Confusing '...' with '---'. Use '---' to split documents and '...' to mark the complete termination of the document stream.

Indentation & HierarchyBasic Syntax & Layout

YAML uses whitespace indentation to define structure and parent-child relationships instead of brackets or braces.

SYNTAX / FORMAT:
parent:
  child:
    grandchild: value
EXAMPLE USECASE:
database:
  connection:
    host: localhost
    port: 5432
COMMON PITFALL:

Using tab characters for indentation. YAML strictly forbids tabs. Ensure your editor converts tab keys to spaces.

Scalar Types (Data Types)5 ENTRIES

IntegersScalar Types (Data Types)

Represents whole numbers. Supports decimal, hexadecimal (base 16), octal (base 8), and binary (base 2).

SYNTAX / FORMAT:
decimal: 42
hexadecimal: 0x2A
octal: 0o52
binary: 0b101010
EXAMPLE USECASE:
max_connections: 100
color_mask: 0xFF00AA
file_permission: 0o755
bit_flags: 0b00101100
COMMON PITFALL:

Writing octal values as '0755' instead of '0o755'. In YAML 1.2, leading zeros without 'o' are parsed as decimals (755), not octals.

Floating Point NumbersScalar Types (Data Types)

Represents real numbers with fractional parts, exponential notation, or special values like infinity and NaN.

SYNTAX / FORMAT:
float: 3.1415
exponential: 6.022e23
infinity: .inf
not_a_number: .nan
EXAMPLE USECASE:
pi_value: 3.14159265
delay_multiplier: 1.5e-3
max_timeout: .inf
error_rate: .nan
COMMON PITFALL:

Omitting decimals in exponential values or assuming standard JSON parsers will handle '.inf' and '.nan' values without preprocessing.

BooleansScalar Types (Data Types)

Represents logical truth values (true or false).

SYNTAX / FORMAT:
key: true
key: false
EXAMPLE USECASE:
enable_cache: true
force_ssl: false
COMMON PITFALL:

In YAML 1.1, values like 'yes/no', 'on/off' are treated as booleans. If you write 'country: NO' (for Norway), it will be parsed as 'false'. Use quotes: 'country: "NO"'.

NullsScalar Types (Data Types)

Represents missing, undefined, or empty values.

SYNTAX / FORMAT:
key: null
key: ~
key: 
EXAMPLE USECASE:
middle_name: null
recovery_email: ~
optional_notes: 
COMMON PITFALL:

Assuming an empty quoted string 'key: ""' is parsed as null. It is parsed as a string of length zero. Use unquoted 'null' or '~' for nulls.

Timestamps & DatesScalar Types (Data Types)

Represents calendar dates and times using ISO 8601 formatting.

SYNTAX / FORMAT:
date: YYYY-MM-DD
timestamp: YYYY-MM-DDThh:mm:ss.sZ
EXAMPLE USECASE:
release_date: 2026-07-01
created_at: 2026-07-01T13:00:00Z
local_time: 2026-07-01T07:30:00-05:00
COMMON PITFALL:

Forgetting to quote timestamps when they need to be treated as plain strings by the application (e.g. database keys or version labels).

String Styles6 ENTRIES

Unquoted (Plain) StringsString Styles

Strings written without single or double quotes. Convenient but subject to parsing restrictions.

SYNTAX / FORMAT:
key: string content
EXAMPLE USECASE:
greeting: Hello and welcome to OpenDev Hub
COMMON PITFALL:

Including special YAML characters like ':', '#', '{', '}', '[', ']', or '&' in plain strings. If a string starts with or contains these characters, it must be quoted.

Single-Quoted StringsString Styles

Strings enclosed in single quotes. Preserves all characters as literals and does not process escape sequences.

SYNTAX / FORMAT:
key: 'string content'
EXAMPLE USECASE:
windows_path: 'C:\Users\admin\documents'
regex_pattern: '^\d{3}-\d{2}-\d{4}$'
COMMON PITFALL:

Attempting to escape characters with backslashes (e.g., '\n' inside single quotes renders as a literal backslash followed by 'n'). To escape a single quote itself, double it: 'It''s working'.

Double-Quoted StringsString Styles

Strings enclosed in double quotes. Processes escape sequences like '\n' (newline), '\t' (tab), and unicode characters.

SYNTAX / FORMAT:
key: "string content"
EXAMPLE USECASE:
welcome_message: "Welcome to OpenDev Hub!\nEnjoy your stay.\t🚀"
COMMON PITFALL:

Forgetting to escape backslashes when they should be literal (e.g., 'path: "C:\temp"' will escape '\t' as a tab). Use double backslashes: 'path: "C:\\temp"'.

Literal Block Scalar (|)String Styles

Preserves all newlines and trailing whitespace in a multi-line string. Ideal for code blocks, logs, or certificates.

SYNTAX / FORMAT:
key: |
  indented multiline string
  second line
EXAMPLE USECASE:
nginx_config: |
  server {
      listen 80;
      server_name localhost;
  }
COMMON PITFALL:

Using a tab for indentation within the block or indenting the block lines less than or equal to the parent key's indentation.

Folded Block Scalar (>)String Styles

Replaces single newlines in a multi-line block with spaces, folding the text into a single paragraph. Double newlines (blank lines) are preserved.

SYNTAX / FORMAT:
key: >
  first line
  second line
EXAMPLE USECASE:
meta_description: >
  OpenDev Hub is a neobrutalist platform
  built for modern developers.
  It provides fast tools, cheatsheets,
  and live event trackers.
COMMON PITFALL:

Expecting newlines to be preserved. If line breaks are important (such as for scripting or certs), use the Literal scalar '|' instead.

Chomping Indicators (+ / -)String Styles

Appended to '|' or '>' block scalars to control trailing newlines. Strip (-) removes all trailing newlines, Keep (+) retains them, and default Clip keeps exactly one.

SYNTAX / FORMAT:
strip: |-
  content
keep: |+
  content
EXAMPLE USECASE:
private_key: |-
  -----BEGIN PRIVATE KEY-----
  MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC3
  -----END PRIVATE KEY-----
license_footer: |+
  Copyright (c) 2026 OpenDev Hub


COMMON PITFALL:

Omitting the chomping indicator on files that are sensitive to trailing whitespace, such as private keys, breaking SSH handshakes.

Collections & Mappings5 ENTRIES

Block Sequences (Lists)Collections & Mappings

Ordered lists of values represented by bullet points using hyphens, aligned at the same indentation level.

SYNTAX / FORMAT:
- item1
- item2
EXAMPLE USECASE:
supported_frameworks:
  - React
  - Next.js
  - Tailwind CSS
COMMON PITFALL:

Forgetting the space after the hyphen (e.g. '-item'). This will parse as a single plain string '-item' rather than a list element.

Flow Sequences (Inline Lists)Collections & Mappings

Inline lists wrapped in square brackets, similar to JSON array syntax.

SYNTAX / FORMAT:
[item1, item2, item3]
EXAMPLE USECASE:
allowed_methods: [GET, POST, OPTIONS]
COMMON PITFALL:

Omitting commas between list elements or mixing block sequences with flow sequences without proper indentation.

Block Mappings (Dictionaries)Collections & Mappings

Key-value pairs organized on multiple lines using indentation.

SYNTAX / FORMAT:
key:
  subkey: value
EXAMPLE USECASE:
database_config:
  host: 127.0.0.1
  port: 5432
  username: postgres
COMMON PITFALL:

Keys in the same mapping aligned at different indentation levels, which shifts them into nested or separate parents.

Flow Mappings (Inline Dictionaries)Collections & Mappings

Inline key-value pairs wrapped in curly braces, matching JSON object syntax.

SYNTAX / FORMAT:
{key1: value1, key2: value2}
EXAMPLE USECASE:
headers: { Content-Type: application/json, Authorization: Bearer token123 }
COMMON PITFALL:

Omitting the space after the colon inside the curly braces. Unlike JSON, YAML flow mappings require '{key: value}' with space.

Nested CollectionsCollections & Mappings

Combining mappings and sequences to build complex, multi-dimensional structures.

SYNTAX / FORMAT:
key:
  - subkey1: value1
    subkey2: value2
EXAMPLE USECASE:
environments:
  - name: production
    servers:
      - ip: 192.168.1.10
        role: web
      - ip: 192.168.1.11
        role: db
  - name: staging
    servers:
      - ip: 192.168.2.10
        role: all
COMMON PITFALL:

Improperly aligning hyphens with keys. Subkeys of a list item must be indented consistently with the start of the item.

Advanced Concepts7 ENTRIES

Anchors (&)Advanced Concepts

Marks a block of YAML data with a reference name, allowing it to be reused or duplicated later in the file.

SYNTAX / FORMAT:
key: &anchor_name
  subkey: value
EXAMPLE USECASE:
default_settings: &defaults
  timeout: 30
  retries: 3
  cache_enabled: true
COMMON PITFALL:

Attempting to reference an anchor that has not been defined yet. Anchors must be declared higher up in the file before they are used.

Aliases (*)Advanced Concepts

References a defined anchor to duplicate its content inline without re-writing it.

SYNTAX / FORMAT:
alias_key: *anchor_name
EXAMPLE USECASE:
development_env:
  database: dev_db
  connection_limits: *defaults
COMMON PITFALL:

Using the alias prefix '*' inside double quotes (e.g. '*defaults'). This will make the parser read it as a literal string '*defaults' instead of resolving the alias.

Merge Keys (<<)Advanced Concepts

Used in combination with anchors and aliases to inject all key-values of a referenced map into the current map, allowing overrides.

SYNTAX / FORMAT:
<<: *anchor_name
override_key: new_value
EXAMPLE USECASE:
production_env:
  <<: *defaults
  timeout: 10 # Overrides the default 30
  debug: false
COMMON PITFALL:

Using merge keys (<<) in YAML 1.2 environments where the parser strictly adheres to 1.2 rules (as << was a YAML 1.1 type). Most modern parsers still support it for compatibility, but check parser docs.

Explicit Tags (Data Type Casts)Advanced Concepts

Overrides YAML's implicit type detection by explicitly prefixing values with a type tag.

SYNTAX / FORMAT:
key: !!tag_name value
EXAMPLE USECASE:
string_boolean: !!str true
integer_as_string: !!str 12345
floating_value: !!float 5
COMMON PITFALL:

Typing tags incorrectly (e.g., single exclamation mark '!str' instead of double exclamation marks '!!str'). Custom tags use '!', standard built-ins use '!!'.

Sets (!!set)Advanced Concepts

A collection of unique items where order is not guaranteed. Indicated by the !!set tag, where keys are separated by a question mark.

SYNTAX / FORMAT:
key: !!set
  ? item1
  ? item2
EXAMPLE USECASE:
user_permissions: !!set
  ? read
  ? write
  ? execute
COMMON PITFALL:

Adding duplicate items to a set. The set will collapse duplicates during parsing, resulting in only unique entries.

Ordered Mappings (!!omap)Advanced Concepts

A sequence of key-value pairs where key order is strictly preserved, unlike standard maps which are unordered.

SYNTAX / FORMAT:
key: !!omap
  - key1: value1
  - key2: value2
EXAMPLE USECASE:
deployment_steps: !!omap
  - checkout: git clone
  - install: npm install
  - build: npm run build
  - deploy: pm2 restart app
COMMON PITFALL:

Formatting ordered mappings as a map rather than a sequence of single-key maps (e.g. using bullet points with hyphens). Each key-value pair in an omap must be a sequence element.

Binary Data (!!binary)Advanced Concepts

Encodes binary files (like images, zip files, or PDFs) directly in YAML as a Base64-encoded string.

SYNTAX / FORMAT:
key: !!binary |
  base64_encoded_data
EXAMPLE USECASE:
pixel_gif: !!binary |
  R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
COMMON PITFALL:

Leaving out the literal block scalar '|'. Binary data must be formatted as a block scalar to support line folding and spaces in the base64 string.