DynamoMapper
Use this skill when generating or explaining DynamoMapper code.
Core truths
- DynamoMapper is a C# incremental source generator for
T <-> Dictionary<string, AttributeValue>. - Configure mapping on a
static partialmapper class marked with[DynamoMapper]. - The generator recognizes unimplemented partial methods whose names start with
ToorFromand use the expected model/dictionary signatures. - One-way mappers are valid:
To*only orFrom*only. - Domain models usually stay clean except for optional
[DynamoMapperConstructor]on a constructor. - Nested object mapping is implemented and tested.
- Some public docs are stale; use
references/gotchas.mdwhen behavior seems surprising.
Choose a path
- Read
references/core-usage.mdfor mapper shape, attribute behavior, defaults, constructor rules, and common implementation patterns. - Read
references/type-matrix.mdfor supported types, collection rules, nested shapes, and hard limits. - Read
references/diagnostics.mdfor generator diagnostics and the most likely fixes. - Read
references/gotchas.mdfor stale-doc traps and the non-obvious rules most likely to cause bad guidance.
Default workflow
- Identify whether the task is mapper authoring, supported-type lookup, or diagnostics.
- Read the matching reference file before making assumptions.
- If the task touches nested mapping, converters, or hooks, check
references/gotchas.mdbefore answering. - Keep answers concrete and code-oriented.
High-risk misunderstandings
- Do not tell the user to decorate every POCO property; configuration belongs on the mapper class.
- Do not assume methods must be named exactly
ToItemandFromItem; theTo/Fromprefix matters, but the generator also expects the recognized model/dictionary signatures. - Check
references/gotchas.mdbefore teaching hooks or custom converter signatures. - Do not assume every unsupported converter setup becomes a DynamoMapper diagnostic; some become normal C# compile errors.
Reference map
references/core-usage.mdreferences/type-matrix.mdreferences/diagnostics.mdreferences/gotchas.md