Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: Add Default MappingTypeConversion and disable explicit casts by default#1881

Merged
latonz merged 1 commit intoriok:mainfrom
zchung:new-mapping-conversion-type-issue-1638
Dec 22, 2025
Merged

fix: Add Default MappingTypeConversion and disable explicit casts by default#1881
latonz merged 1 commit intoriok:mainfrom
zchung:new-mapping-conversion-type-issue-1638

Conversation

@zchung
Copy link
Contributor

@zchung zchung commented Jul 9, 2025

Add Default MappingTypeConversion

Description

Added a new flag for a Default MappingTypeConversion, this is a breaking change that will set the default configuration for a mapper to exclude the ExplicitCast Conversion, this will prevent accidental data loss for Explicit Casting.

A lot of the changes are in the test cases, I had to "Explicitly" Add the flags to correctly test the new behavior on existing test cases to ensure they would work

Fixes #1638

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution and efforts!

Since this introduces a breaking change, we'll postpone merging it until fall, when we plan to include it in our next scheduled breaking-change release (together with other breaking changes).

@zchung
Copy link
Contributor Author

zchung commented Jul 10, 2025

@latonz I've updated the unit tests now and removed the explicit casting where applicable and used All for any other cases. I've also removed the extra parameters in the TestOptions class and simplified it to have options for the All Conversion Type only. This should hopefully simplify the test cases.

@zchung zchung requested a review from latonz July 11, 2025 13:32
Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates! I have a couple of small nitpicks.

@zchung zchung requested a review from latonz July 15, 2025 03:55
latonz
latonz previously approved these changes Jul 15, 2025
@latonz latonz added the breaking-change This issue or pull request will break existing consumers label Jul 15, 2025
@latonz latonz force-pushed the new-mapping-conversion-type-issue-1638 branch from fd188e4 to 0dd0244 Compare December 22, 2025 16:50
…ll conversion types except ExplicitCast.

Co-authored-by: Lars <[email protected]>
@latonz latonz force-pushed the new-mapping-conversion-type-issue-1638 branch from 0dd0244 to f1cfaef Compare December 22, 2025 17:05
@latonz latonz added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request bug Something isn't working labels Dec 22, 2025
@latonz latonz merged commit 33b81d6 into riok:main Dec 22, 2025
20 of 21 checks passed
@latonz latonz changed the title Add Default MappingTypeConversion fix: Add Default MappingTypeConversion Dec 22, 2025
@latonz latonz changed the title fix: Add Default MappingTypeConversion fix: Add Default MappingTypeConversion and disable explicit casts by default Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This issue or pull request will break existing consumers bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable explicit cast conversion by default

2 participants