How-to guides
Each guide solves one specific problem, assumes you already know the basics from Getting started, and ends with a runnable example in the companion examples repository.
Shaping the output
- Customize property names — naming policies and
[HumlProperty]overrides. - Ignore properties & omit defaults —
[HumlIgnore],[HumlIgnoreDefaults], and ignore conditions. - Control inline vs multiline — inline dicts/lists per property or globally.
- Serialize dates & times —
DateTime,DateTimeOffset,TimeSpan,DateOnly,TimeOnly. - Work with enums — enum round-trips and
[HumlEnumValue]wire names. - Read & write numbers as strings —
HumlNumberHandlingfor quoted numerics.
Mapping to .NET types
- Bind constructors & records — records,
[HumlConstructor],init-only setters. - Require properties —
[HumlRequired]and the C#requiredmodifier. - Capture unknown keys —
[HumlExtensionData]overflow buckets. - Serialize polymorphic types — discriminator-based dispatch with
[HumlPolymorphic]. - Overlay onto an instance —
HumlSerializer.Populatefor defaults + overrides. - Write a custom converter —
HumlConverter<T>and converter factories.
Robustness and deployment
- Handle errors — the exception contract and strict parsing.
- Publish AOT / trimmed — trim-safe usage and annotations.
- Use the source generator — reflection-free metadata via
HumlGeneratedContext.