Skip to content

Derivation of by-types and Tuple* transformers #394

Answered by MateuszKubuszok
coffius asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, sorry for the late answer but I had a busy week.

  1. if either source or target is a tuple, Chimney always match fields by their positions in the constructor (_1 to _1 or _1 to the first constructor's argument, or the first argument in a case class constructor to _1, etc), otherwise it always match fields and constructor arguments by their names
    • matching by-type-only would hardly ever be possible since most of the time you have mappings from/to e.g. (String, String, String) where there would be more ambiguities to manually resolve than automatically resolved values (kinda defeats the purpose of automation). This basically assumes that both source and target type are different orderin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MateuszKubuszok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants