serde_with

Custom de/serialization helpers for Rust's serde, via the with and serde_as annotations

Library
Cargo
v3.22.0
854stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity96
Maintenance96
Community64
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality88
Innovation78
Learning Curve68

serde_with provides a large library of custom serialization/deserialization adapters for use with serde’s #[serde(with = "...")] attribute and its own more flexible #[serde_as] annotation. It handles common pain points serde doesn’t solve out of the box: converting via Display/FromStr, serializing arrays larger than 32 elements or with const generics, skipping empty Option fields en masse, adding field-name prefixes/suffixes, and parsing delimiter-separated strings into collections.

Maintained by Jonas Bushart since 2017, it’s one of the most widely used serde companion crates in the Rust ecosystem, with well over 300 million total downloads and adapters for many popular crates (chrono, hashbrown, indexmap, and more) gated behind feature flags.

What You Get

  • #[serde_as] attribute with dozens of built-in adapters: DisplayFromStr, Hex, Base64, DurationSeconds, Bytes, and more
  • Support for arrays larger than 32 elements and const-generic arrays, which serde’s derive macros can’t handle natively
  • #[skip_serializing_none] to skip every empty Option field on a struct without annotating each one individually
  • with_prefix!/with_suffix! macros to add a name prefix/suffix to all fields of a struct without touching its de/serialize impls
  • StringWithSeparator for parsing delimiter-separated strings (e.g. comma-separated tags) into typed collections
  • Optional feature-gated integrations for chrono, hashbrown, indexmap, and other common crates’ types

Common Use Cases

  • Serializing/deserializing types via their Display/FromStr impls (e.g. u8 as a JSON string, url::Url, mime::Mime)
  • Working around serde’s 32-element array limitation, especially with const-generic array sizes
  • Compact JSON APIs that omit null/absent optional fields entirely rather than serializing them as null
  • Converting comma- or delimiter-separated string fields (common in config files and query params) into Vec<T>

Under The Hood

Architecture - The repo is a Cargo workspace of three crates: serde_with (the public API, ~22.5k lines across adapters organized by target format like base64.rs, hex.rs, chrono_0_4.rs), serde_with_macros (the proc-macro crate implementing #[serde_as], #[skip_serializing_none], and the derive-macro plumbing), and serde_with_test (an internal integration-test harness); the serde_as attribute works by expanding to type-level wrapper structs that implement Serialize/Deserialize and delegate to the underlying value via the requested conversion. Tech Stack - Built on serde/serde_derive with numerous optional feature-gated dependencies (chrono, hashbrown across several versions, indexmap, base64, hex) so consumers only compile in the adapters they use; edition 2021, MSRV 1.88, dual MIT/Apache-2.0 licensed. Code Quality - Extensive per-adapter integration tests (tests/base64.rs, tests/hex.rs, tests/chrono_0_4.rs, plus a dedicated tests/derives subdirectory), workspace-wide Clippy lints (clippy.toml) and strict rustfmt config, CII Best Practices badge, and Bors-managed merge queue (bors.toml) — signals of a mature, process-disciplined project with 1,784 commits over eight years. API Design - The serde_as annotation’s type-mirroring syntax (Vec<DisplayFromStr>, Option<[_; M]>) is more expressive and composable than serde’s plain with attribute, letting nested nested generic types each specify their own conversion, at the cost of a steeper initial learning curve for developers unfamiliar with the type-mirroring convention.

Used by 10 apps in this directory

Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
TypeScript
72%
AGPL 3.0

Firecrawl

AI Development · Developer Tools

169,311

Turn any website into clean, LLM-ready data with a single API call — no proxy headaches, no scraping complexity.

View details
89
Repo Health
83
Technical
66
Dependency
Built with
TypeScript72%
Python14%
Updated today
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
Rust
36%
Apache 2.0

LanceDB

Databases · AI Development

11,190

Open-source, embedded vector database built on the Lance columnar format for fast multimodal search across billions of vectors, backed by Y Combinator (W23).

View details
90
Repo Health
86
Technical
72
Dependency
Built with
Rust36%
HTML30%
Python26%
Updated today
Rust
96%
Apache 2.0

codex

AI Code Assistants · Developer Tools

106,760

OpenAI's open-source CLI coding agent that reads, edits, and runs code in your terminal using natural language prompts.

View details
89
Repo Health
80
Technical
77
Dependency
Built with
Rust96%
Updated today
Rust
63%
MIT

PostgresML

Databases · AI Development

6,817

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
65
Dependency
Built with
Rust63%
JavaScript11%
Updated 1 years ago
Rust
67%
Apache 2.0

Rivet

AI Agents · Developer Tools

6,065

Stateful actors as a primitive for AI agents, real-time collaboration, and durable execution — with in-memory state, WebSockets, queues, and scheduling built in.

View details
86
Repo Health
81
Technical
66
Dependency
Built with
Rust67%
TypeScript29%
Updated today
Rust
77%
AGPL 3.0

Spacedrive

File Storage · Collaboration

38,790

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
60
Repo Health
84
Technical
65
Dependency
Built with
Rust77%
TypeScript20%
Updated 3 weeks ago
Rust
98%
Apache 2.0

Volga

Data Engineering

158

A Rust-based real-time data processing engine for AI/ML feature computation, built on Apache DataFusion and Arrow — positioned as an alternative to Flink, Spark, Chronon, and OpenMLDB with unified streaming, batch, and request-time execution.

View details
67
Repo Health
67
Technical
72
Dependency
Built with
Rust98%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search