[kotlin][client] Explode query param properly (#20714)

This commit is contained in:
Maksim Kosolapov
2025-02-26 10:52:03 +03:00
committed by GitHub
parent 5f92de4785
commit 09df01501a
2 changed files with 66 additions and 3 deletions

View File

@@ -391,7 +391,24 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
.apply {
if (queryObject != null) {
put("query_object", listOf(queryObject.toString()))
if (queryObject.id != null) {
put("queryObject[id]", listOf(queryObject.id.toString()))
}
if (queryObject.name != null) {
put("queryObject[name]", listOf(queryObject.name.toString()))
}
if (queryObject.category != null) {
put("queryObject[category]", listOf(queryObject.category.toString()))
}
if (queryObject.photoUrls != null) {
put("queryObject[photoUrls]", toMultiValue(queryObject.photoUrls.toList(), ""))
}
if (queryObject.tags != null) {
put("queryObject[tags]", toMultiValue(queryObject.tags.toList(), ""))
}
if (queryObject.status != null) {
put("queryObject[status]", listOf(queryObject.status.value))
}
}
}
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -469,7 +486,9 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
.apply {
if (queryObject != null) {
put("query_object", listOf(queryObject.toString()))
if (queryObject.propertyValues != null) {
put("values", toMultiValue(queryObject.propertyValues.toList(), ""))
}
}
}
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -547,7 +566,24 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
.apply {
if (queryObject != null) {
put("query_object", listOf(queryObject.toString()))
if (queryObject.id != null) {
put("id", listOf(queryObject.id.toString()))
}
if (queryObject.name != null) {
put("name", listOf(queryObject.name.toString()))
}
if (queryObject.category != null) {
put("category", listOf(queryObject.category.toString()))
}
if (queryObject.photoUrls != null) {
put("photoUrls", toMultiValue(queryObject.photoUrls.toList(), ""))
}
if (queryObject.tags != null) {
put("tags", toMultiValue(queryObject.tags.toList(), ""))
}
if (queryObject.status != null) {
put("status", listOf(queryObject.status.value))
}
}
}
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()