Repository navigation
Harden MappingConfiguration generator for real-world type scenarios - #12
Merged
Merged
Conversation
…positional records
…sions in constructor matching
…d renamed constructor params
…ed sub-method generation
davidkallesen
force-pushed
the
feature/ATCMCF014
branch
from
March 13, 2026 23:11
490aa1b to
91d8312
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly improves the MappingConfiguration and Object Mapping generators to handle real-world type
scenarios encountered when mapping between generated API types (from Atc.Rest.Api.SourceGenerator) and domain
types. It fixes multiple issues with positional records, struct handling, nullable types, and metadata-loaded
types, while adding new built-in type conversions and auto-generated nested mapping sub-methods.
Changes
✨ Features
Enum.TryParsemappings
Nullable<T>) across all type analysisBlock_DE_L2→BlockDEL2)🐛 Fixes
?.) on value type nested mappings — use direct call for struct sources?.MapToX()!which producesT?if (source is null)) emitted for struct input parameters[MapConfigProperty]generating object initializer instead of constructor for positional records withrenamed properties
uint→int, etc.) rejected in constructor matchingIList<A>→List<B>) rejected in constructor matching♻️ Refactoring
UnwrapNullableandIsNullableValueTypehelpers into sharedMappingTypeAnalyzerSourceCollectionElementTypetoPropertyMappingrecord for same-element-type detectionConstructorDefaultParameterrecord for partial constructor matching with defaultsNotes
skipped" issue — the real problem was Roslyn hiding
SetMethodon metadata-loaded typesCompileToAssemblyandGetGeneratedOutputWithAssemblyReferencehelpers fortesting metadata-vs-source symbol behavior