-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Aghogho Bernard edited this page May 12, 2026
·
3 revisions
A lightweight, flexible JSON-to-object mapper for C# that handles third-party API responses with mismatched property names and nested structures — without requiring per-API contract definitions.
- Getting Started — Installation and a 10-line example
-
Configuration Reference — Every
Optionproperty explained - Mapping Modes — How Create Mode and Update Mode work, and when each is chosen
- Examples — Direct mapping, custom names, nested keys, root-key dot notation
- Exceptions — When each exception is thrown and how to recover
- Troubleshooting — Common pitfalls and how to diagnose them
In organizations that integrate with multiple external APIs, you frequently hit:
-
Property mismatches: their
workEmailvs yourWorkEmail, theirdescvs yourDescription -
Nested structures: data buried under
data.products[]orwork.reportsTo.email - Per-integration boilerplate: every new API requires its own contract / DTO / wire types
CustomAutoAdapterMapper lets you keep one strongly-typed model and supply per-integration mapping configuration at the call site:
var apiResponse = await httpClient.GetStringAsync("https://api.example.com/employees");
var employees = new List<Employee>();
apiResponse.MapCollection(employees, options =>
{
options.RootKey = "employees";
options.ItemKey = "Email";
options.Mappings = new Dictionary<string, string>
{
{ "Email", "workEmail" }, // their JSON key → your C# property
{ "FirstName", "firstName" },
{ "ManagerEmail", "supervisorEmail" }
};
});The library leaves direct property-name matches alone and only consults the Mappings dictionary for properties whose JSON name differs.
- GitHub Repository: https://github.com/teghoz/CustomAutoAdapterMapper
- NuGet Package: https://www.nuget.org/packages/CustomAutoAdapterMapper/
- Issues / Discussion: https://github.com/teghoz/CustomAutoAdapterMapper/issues
.NET Standard 2.0 — works with .NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+.
The library follows semantic versioning. See the Changelog for release notes.