nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: cjbooms/fabrikt
Pull request #52 (2021-06-08 13:37:31)

Fixing bug when generating HTTP parameters on an non-exploded format.
The parameters are concatenated by default with ", ", leaving a space between the comma and the next parameter


Patch:
diff --git a/src/main/resources/templates/client-code/http-util.kt.hbs b/src/main/resources/templates/client-code/http-util.kt.hbs
index f0d3507..5d12554 100644
--- a/src/main/resources/templates/client-code/http-util.kt.hbs
+++ b/src/main/resources/templates/client-code/http-util.kt.hbs
@@ -24,7 +24,7 @@ fun <T : Any> FormBody.Builder.formParam(key: String, value: T?): FormBody.Build
 fun HttpUrl.Builder.queryParam(key: String, values: List<String>?, explode: Boolean = true) = this.apply {
     if (values != null) {
         if (explode) values.forEach { addQueryParameter(key, it) }
-        else addQueryParameter(key, values.joinToString())
+        else addQueryParameter(key, values.joinToString(","))
     }
 }
 


Test patch:
diff --git a/src/test/resources/examples/okHttpClient/client/HttpUtil.kt b/src/test/resources/examples/okHttpClient/client/HttpUtil.kt
index 3a398ac..45b50d0 100644
--- a/src/test/resources/examples/okHttpClient/client/HttpUtil.kt
+++ b/src/test/resources/examples/okHttpClient/client/HttpUtil.kt
@@ -24,7 +24,7 @@ fun <T : Any> FormBody.Builder.formParam(key: String, value: T?): FormBody.Build
 fun HttpUrl.Builder.queryParam(key: String, values: List<String>?, explode: Boolean = true) = this.apply {
     if (values != null) {
         if (explode) values.forEach { addQueryParameter(key, it) }
-        else addQueryParameter(key, values.joinToString())
+        else addQueryParameter(key, values.joinToString(","))
     }
 }