Skip to content

fix: apply EmptyCollectionIfNull to record constructor args (#943)#973

Closed
leno23 wants to merge 2 commits into
MapsterMapper:developmentfrom
leno23:fix/empty-collection-transform-ctor-943-dev
Closed

fix: apply EmptyCollectionIfNull to record constructor args (#943)#973
leno23 wants to merge 2 commits into
MapsterMapper:developmentfrom
leno23:fix/empty-collection-transform-ctor-943-dev

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

  • Apply EmptyCollectionIfNull (and other destination transforms) to record/class constructor arguments when null sources would otherwise skip transforms.
  • Skip destination transforms when a member has an explicit .Map() resolver so explicit null mappings are preserved.

Fixes #943
Relates to #952 (ctor-parameter path; property path covered by #966)

Test plan

wuyangfan and others added 2 commits May 25, 2026 15:52
…apper#943)

Apply destination transforms when null-propagation is skipped for ctor
parameters and when building record constructor arguments.

Co-authored-by: Cursor <cursoragent@cursor.com>
…erMapper#943, MapsterMapper#952)

Do not apply EmptyCollectionIfNull when a member has an explicit Map
resolver, including record constructor parameters.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

Heads-up for review: #943 ctor-path transforms were partially addressed upstream in #945 (development). This PR additionally wires ApplyDestinationTransform + explicit-map skip (HasExplicitMemberMap) on the ctor path — overlapping with #966 (#952) on the adapter path. The added regression test currently references #952 (explicit null vs EmptyCollectionIfNull), same scenario as #966; happy to rebase onto latest development and split/rename tests if that helps review.

@leno23
Copy link
Copy Markdown
Author

leno23 commented May 27, 2026

Consolidated into #966: ctor-path ApplyDestinationTransform + explicit-map skip now lives on fix/explicit-null-map-952-dev with record-ctor regression coverage in WhenPerformingDestinationTransforms. #943 baseline remains on development via #945.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant