Skip to content

Commit

Permalink
Merge pull request #728 from 2m/fix/macro-warning-2m
Browse files Browse the repository at this point in the history
Use `transform` when mapping Map values
  • Loading branch information
adamw authored Aug 26, 2020
2 parents 07a4a17 + e7272f0 commit 6f34829
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object FormCodecMacros {
val codecTree = q"""
{
def decode(params: Seq[(String, String)]): sttp.tapir.DecodeResult[$t] = {
val paramsMap: Map[String, Seq[String]] = params.groupBy(_._1).mapValues(_.map(_._2)).toMap
val paramsMap: Map[String, Seq[String]] = params.groupBy(_._1).transform((_, v) => v.map(_._2))
val decodeResults = List(..$decodeParams)
sttp.tapir.DecodeResult.sequence(decodeResults).map { values =>
${util.instanceFromValues}
Expand Down

0 comments on commit 6f34829

Please sign in to comment.