Skip to content

Commit

Permalink
[scala-akka-client] Scala Akka client does not support arbitrary quer…
Browse files Browse the repository at this point in the history
…y string parameters (#17386)

* Add check for input if is Map type

* Update Pet samples

* Add PetApi support for filter by Pet property

* Clean up

* update samples

* remove manual test

---------

Co-authored-by: ameenhaq <[email protected]>
  • Loading branch information
wing328 and ameenhaq committed Dec 13, 2023
1 parent 42f7219 commit 734b922
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ case class ApiRequest[U](
def withPathParam(name: String, value: Any): ApiRequest[U] = copy[U](pathParams = pathParams + (name -> value))
def withQueryParam(values: Map[String, Any]): ApiRequest[U] = copy[U](queryParams = queryParams ++ values)
def withQueryParam(name: String, value: Any): ApiRequest[U] = copy[U](queryParams = queryParams + (name -> value))
def withHeaderParam(name: String, value: Any): ApiRequest[U] = copy[U](headerParams = headerParams + (name -> value))
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"{{baseName}}", {{#isContainer}}ArrayValues({{{paramName}}}{{#collectionFormat}}, {{collectionFormat.toUpperCase}}{{/collectionFormat}}){{/isContainer}}{{^isContainer}}{{{paramName}}}{{/isContainer}}
{{#isMap}}{{baseName}}{{/isMap}}{{^isMap}}"{{baseName}}", {{#isContainer}}ArrayValues({{{paramName}}}{{#collectionFormat}}, {{collectionFormat.toUpperCase}}{{/collectionFormat}}){{/isContainer}}{{^isContainer}}{{{paramName}}}{{/isContainer}}{{/isMap}}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ case class ApiRequest[U](

def withPathParam(name: String, value: Any): ApiRequest[U] = copy[U](pathParams = pathParams + (name -> value))

def withQueryParam(values: Map[String, Any]): ApiRequest[U] = copy[U](queryParams = queryParams ++ values)

def withQueryParam(name: String, value: Any): ApiRequest[U] = copy[U](queryParams = queryParams + (name -> value))

def withHeaderParam(name: String, value: Any): ApiRequest[U] = copy[U](headerParams = headerParams + (name -> value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class PetApiTest extends AsyncFlatSpec with Matchers {

it should "find pets by status" in {
val request = api.findPetsByStatus(List("available"))

invoker
.execute(request)
.map { apiResponse =>
Expand Down

0 comments on commit 734b922

Please sign in to comment.