Skip to content

Commit bd0b81d

Browse files
authored
Update baseClient.mustache for scala-http4s (#21825)
The code for setting the form body parameters were wrong, e.g. the key value pair (id, 12345) would be encoded as id=%28id%2C12345%29 This commit adds a fix to the base client to correctly setting formBody values the previous pair will now be encoded as id=12345
1 parent afedd3f commit bd0b81d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/openapi-generator/src/main/resources/scala-http4s/baseClient.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ abstract class BaseClient[F[*]: Concurrent](
6666
request.putHeaders(Header.Raw(CIString(name), value))
6767
}
6868
val formBody = formParameters.map { x =>
69-
UrlForm(x.groupBy(_._1).map{case (k, v) => (k, v.mkString(","))}.toSeq*)
69+
UrlForm(x.groupBy(_._1).map { case (k, v) => (k, v.map(_._2).mkString(",")) }.toSeq*)
7070
}
7171

7272
import JsonSupports.*

samples/client/petstore/scala-http4s/src/main/scala/org/openapitools/client/apis/BaseClient.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ abstract class BaseClient[F[*]: Concurrent](
7575
request.putHeaders(Header.Raw(CIString(name), value))
7676
}
7777
val formBody = formParameters.map { x =>
78-
UrlForm(x.groupBy(_._1).map{case (k, v) => (k, v.mkString(","))}.toSeq*)
78+
UrlForm(x.groupBy(_._1).map { case (k, v) => (k, v.map(_._2).mkString(",")) }.toSeq*)
7979
}
8080

8181
import JsonSupports.*

0 commit comments

Comments
 (0)