serde_yaml
Strongly typed YAML serialization and deserialization for Rust, built on Serde
Repository Health
Technical Analysis
serde_yaml plugs the YAML 1.1 data format into the Serde serialization framework, so any Rust type that derives Serialize/Deserialize can be converted to and from YAML documents with the same type safety Serde provides for JSON, TOML, and other formats. It supports structs, enums (including YAML’s !Tag variant syntax), maps, sequences, and Serde’s full derive-macro ecosystem, backed internally by unsafe-libyaml, a Rust port of libyaml.
The crate is authored by David Tolnay, maintainer of Serde itself, and has been a long-standing default choice for YAML handling in the Rust ecosystem — used for parsing configuration files, Kubernetes-style manifests, and CI definitions. As of the final 0.9.34 release the crate is explicitly marked deprecated/no-longer-maintained by its author, though the existing API remains usable and widely depended upon.
What You Get
serde_yaml::to_string/from_strfor round-tripping any Serde-derived type through YAML- A
Valueenum for working with untyped/dynamic YAML documents when a concrete type isn’t known upfront - Support for YAML’s
!Tagenum-variant syntax mapping onto Rust enum variants - A
withmodule of helper (de)serializers for common non-default YAML representations - Integration with Serde’s full ecosystem of derive attributes (renames, defaults, flattening, etc.)
Common Use Cases
- Loading application configuration files written in YAML into strongly typed Rust config structs
- Parsing and generating Kubernetes-style or CI-pipeline YAML manifests programmatically
- Converting between YAML and other Serde-supported formats (JSON, TOML) via a shared intermediate type
- Working with untyped YAML documents via
serde_yaml::Valuewhen the schema isn’t known ahead of time
Under The Hood
Architecture - The crate implements Serde’s Serializer (src/ser.rs) and Deserializer (src/de.rs, ~1,850 lines) traits on top of an internal loader.rs that walks events produced by the bundled libyaml port, translating YAML’s node model (scalars, sequences, mappings, tagged variants) into Serde’s visitor callbacks; a separate value/ module provides an untyped Value enum and a mapping.rs ordered-map type for cases where the target schema isn’t known statically. Tech Stack - Pure Rust (edition 2021, MSRV 1.64), depending on unsafe-libyaml (a hand-ported, dependency-free Rust translation of the C libyaml parser) rather than an FFI binding, plus indexmap, itoa, and ryu for ordered maps and fast number formatting; it has no dependency on Serde beyond the core crate. Code Quality - tests/ covers deserialization (test_de.rs), serialization round-trips, error paths (test_error.rs), and the Value type separately, and the crate ships a fuzz/ target for the parser; the author (Serde’s maintainer) is known for rigorous API design, though the crate carries the +deprecated version suffix and the README states it is no longer maintained, so no further bug fixes should be expected upstream. API Design - The public API mirrors serde_json’s (to_string/from_str/Value) closely, which makes it near-zero-friction for anyone already familiar with Serde-based JSON handling, and the with module supplies ready-made (de)serializers for YAML-specific quirks like optional-vs-null distinctions.
Used by 22 apps in this directory
Anarlog
Note Taking · AI Assistants · Productivity
Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.
AppFlowy
Productivity · Project Management · Collaboration
The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.
BrowserOS
Browser · AI Assistants
The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.
Zen Browser
Browser
A Firefox-based browser that puts focus, privacy, and workflow front-and-centre without sacrificing compatibility
fabro
Developer Tools · Devops
Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.
Fern
Developer Tools
Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.
iii
Developer Tools · Devops
Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.
Jan
AI Assistants
Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.
Kuku
Note Taking
A local-first, open-source Markdown knowledge workspace for macOS — plain files, personal wiki and Second Brain workflows, AI-assisted diffs, and encrypted sync, built as an Obsidian alternative.