CodecMapper

CodecMapper is a schema-first serialization library for F# focused on explicit contracts, symmetric encode/decode behavior, and portability across .NET AOT and Fable-oriented targets.
Tutorials
Tutorials are for first learning.
- Introduction Learn the core mental model before branching into format or integration details.
- Getting Started Follow one linear path from basic schema authoring to nested contracts and validated wrappers.
Recommended order after that:
- How To Model A Basic Record
- How To Model A Nested Record
- How To Model A Validated Wrapper
- How To Model A Versioned Contract
How-To Guides
How-to guides are for goal-oriented tasks.
- Contract Pattern Index Jump to the most common authored-schema patterns.
- How To Model A Basic Record Start from the smallest flat object mapping.
-
How To Model A Nested Record
Keep child schema boundaries explicit with
fieldWith. -
How To Model A Validated Wrapper
Use
Schema.tryMapfor smart-constructor domain types. - How To Model A Versioned Contract Add an explicit version envelope for evolving messages and config.
- Configuration As An Explicit Contract Model versioned application configuration in JSON, YAML, XML, or key/value form.
-
How To Export JSON Schema
Generate JSON Schema documents from authored
Schema<'T>contracts. -
How To Import Existing C# Contracts
Choose between
CSharpSchema, the serializer-attribute bridge, and JSON Schema import for C#-heavy systems. -
How To Profile Benchmark Hot Paths
Capture repeatable
perfdata for benchmarked JSON hot paths. - Benchmarks See the current scenario matrix in tabular form with brief workload-level takeaways.
Reference
Reference docs are for supported behavior and lookup.
- JSON Schema Support Reference Check the supported export/import surface and fallback boundaries.
- API Reference Browse the public API surface generated from the inline docs.
Explanations
Explanations are for design reasoning and mental models.
- JSON Schema in CodecMapper Understand the structural parsing model and when raw JSON fallback is appropriate.
Product Summary
- Author one explicit schema and compile it into reusable codecs.
- Keep encode and decode semantics together.
- Reuse the same contract across JSON and XML, with config-oriented YAML and KeyValue projections where appropriate.
- Keep dynamic JSON receive paths explicit through
Schema.jsonValueand JSON Schema import boundaries.
CodecMapper