Skip to content

fix: skip destination transforms for explicit member maps (#952, ctor path) - #966

Closed
wyf027 wants to merge 2 commits into
MapsterMapper:developmentfrom
wyf027:fix/explicit-null-map-952-dev
Closed

fix: skip destination transforms for explicit member maps (#952, ctor path)#966
wyf027 wants to merge 2 commits into
MapsterMapper:developmentfrom
wyf027:fix/explicit-null-map-952-dev

Conversation

@wyf027

@wyf027wyf027 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Explicit .Map(...) configuration now takes precedence over global DestinationTransform rules such as EmptyCollectionIfNull
  • Prevents explicit null member mappings from being overridden by collection transforms

Fixes#952

Test plan

  • CI passes (WhenPerformingDestinationTransforms.Explicit_Null_Mapping_Is_Not_Overridden_By_EmptyCollectionIfNull)

Explicit .Map(...) configuration should take precedence over global
DestinationTransform rules such as EmptyCollectionIfNull.
Co-authored-by: Cursor <cursoragent@cursor.com>
…952)
Do not apply EmptyCollectionIfNull when a member has an explicit Map
resolver, including record constructor parameters.
Co-authored-by: Cursor <cursoragent@cursor.com>
@wyf027

Copy link
Copy Markdown
ContributorAuthor

Updated 8b8898a: merged ctor-path fix from former #973ApplyDestinationTransform on record/class ctor args + explicit .Map skip in ApplyNullPropagationFromCtor. Added Explicit_Null_Record_Ctor_Mapping_Is_Not_Overridden_By_EmptyCollectionIfNull alongside existing property-map regression (#952). Covers both adapter and ctor instantiation paths.

@wyf027wyf027 changed the title fix: skip destination transforms for explicit member maps (#952)fix: skip destination transforms for explicit member maps (#952, ctor path)May 27, 2026
@wyf027

Copy link
Copy Markdown
ContributorAuthor

CI note: latest push 8b8898a — workflow still action_required (fork). Once Build and Test is approved, this covers both paths:\n- property mapping (BaseAdapter)\n- record/class ctor args (BaseClassAdapter + ApplyDestinationTransform)\n\nBuilds on #945 (#943) already on development.

@wyf027

Copy link
Copy Markdown
ContributorAuthor

Batch ping: #966, #970, #971, #976, #979 (and other open fork PRs) are rebased on latest development (11853b3) and mergeable — all waiting on maintainer Build and Test workflow approval. Happy to address review feedback once CI runs.

@wyf027

Copy link
Copy Markdown
ContributorAuthor

Open fork PRs (2026-05-27) — all rebased on development (11853b3), mergeable, awaiting Build and Test workflow approval:

PRType
#979test (#938 UseDestinationValue)
#966fix (#952 + ctor)
#970fix (#900 MapToTarget)
#971fix (#898 ProjectToType)
#976fix (#947 MapWith cast)
#977fix (#801 projection Include)
#965, #972test-only

Happy to address review feedback once CI runs.

@wyf027wyf027 closed this by deleting the head repository Jun 23, 2026
Sign up for freeto 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

@wyf027