Skip to content

Commit bde2343

Browse files
committed
fix(android): fix invalid encoding of scopes in query parameters
Before this, the `it.value.toString()` caused the list of scopes to be encoded like `scopes[]=[scope1, scope2]` which is invalid. This change fixes the encoding to `scopes[]=scope1&scopes[]=scope2` as expected by the server.
1 parent 9754b19 commit bde2343

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/android/library/src/main/java/io/package/services/Service.kt.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
8484
return@forEach
8585
}
8686
is List<*> -> {
87-
apiQuery.add("${it.key}[]=${it.value.toString()}")
87+
(it.value as List<*>).forEach { v ->
88+
apiQuery.add("${it.key}[]=${v.toString()}")
89+
}
8890
}
8991
else -> {
9092
apiQuery.add("${it.key}=${it.value.toString()}")

0 commit comments

Comments
 (0)