Allow configurable "Umlaut" property name matching
Is your feature request related to a problem? Please describe. We have a dotnet backend with an Angular frontend. Since we use DDD and our UL uses german, we frequently run in the problem that our DTOs would contain umlauts (like ä, ö, ü) in type names and properties, which would cause warnings and errors in TypeScript.
To circumvent this, we use "ae", "oe", "ue" instead of umlauts in our DTOs. However, this increases the amount of mapper configuration in Mapperly by a lot.
Describe the solution you'd like We would welcome a feature that allows Mapperly to automatically match property names with umlauts to their two-character equivalents (and maybe other such characters).
This could be a new option(s) for PropertyNameMappingStrategy for example, and would be off by default for backwards compatibility and to prevent confusion in languages that do not need this.
Describe alternatives you've considered
Manually configuring the mappings with MapProperty. This however, can lead to a significantly increase in the amount of configuration needed, depending on nesting.
Additional context I can offer to try to implement this, after it is discussed and clear how the feature would look and work.
Thank you!
The approach outlined here would also address your use-case, correct?
Ah! I did not see that discussion. Sorry. We can continue this discussion there and close this one if you would like.
Yes, that looks like it would work. That would look something like this, I guess? Would there be a way to combine these, and/or would IncludeMappingConfiguration attribute work with this?
[MapperRenameProperty("Ü", "Ue")]
[MapperRenameProperty("ü", "ue")]
[MapperRenameProperty("Ö", "Oe")]
[MapperRenameProperty("ö", "oe")]
[MapperRenameProperty("Ä", "Ae")]
[MapperRenameProperty("ä", "ae")]
public partial class MyMapper;
As it is defined on the mapper class it is probably not included with the include config, but could probably also be defined for the assembly similar to how MapperlyDefaults work.
Yes, that would work for us.