Proposed breaking changes for Mapperly 4.0
A list of proposed breaking changes for Mapperly 4.0: To be discussed, if a particular change on the list leads to major discussions, we should create a separate issue.
- ✅ Strict Mappings by default (level warning) (#1353)
1.1. Change the default severity of
RMG012: Source member was not found for target membertoWarning1.2. Change the default severity ofRMG020: Source member is not mapped to any target membertoWarning1.3. Change the default severity ofRMG037: An enum member could not be found on the source enumtoWarning1.4. Change the default severity ofRMG038: An enum member could not be found on the target enumtoWarning - ✅ Replace
MapPropertyAttribute.ctor(string[], string[])withMapPropertyAttribute.ctor(string, string[])andMapPropertyAttribute.ctor(string[], string)since member paths are only supported on one side by Mapperly (https://github.com/riok/mapperly/pull/1354). - Change the default of
MapperAttribute.AutoUserMappingstofalse. - Change the default of
MapperAttribute.PreferParameterlessConstructorstofalse - Change the default severity of
RMG060: Multiple user mappings discovered without specifying an explicit defaulttoError(requiresMapperAttribute.AutoUserMappingsdefault tofalsedue to Before/After-Map). - ✅ Change the enabled conversions check for underlaying enum types from
ExplicitCastto a newEnumUnderlayingTypeconversion (#1176, #1352)
What is the justification of no. 3?
@wrestlerdude the idea is to get to a more explicit API and prevent accidental / non-intuitive use of a mapping method by Mapperly.
Why do you consider changing the severity to Warning a breaking change on no. 1? Am I missing something? 🤔
It is not really a breaking change, but we decided to postpone this change to the next major release since it may still need adjustments by all users that have TreatWarningsAsErrors enabled (which AFAIK is quite common).
We decided to not implement 3), 4) and 5) for now to keep breaking changes limited. All other breaking changes are merged.