OpenAPITools / OpenAPITools/openapi-generator
[BUG] [scala-akka-client] Scala Akka client does not support arbitrary query string values
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When generating an api with an endpoint that takes an arbitrary set of query string parameters, which is to be represented as Map[String, Any] in the client, the generated code tries to use a query parameter append method that does not support the Map[String, Any] data type.
openapi-generator version
Latest
OpenAPI declaration file content or url
/api/v1/query:
get:
summary: Get a result using some filters
operationId: getQuery
parameters:
- name: filter
in: query
required: false
schema:
type: object
additionalProperties: true
Suggest a fix
Currently, it utilises a method withQueryParam which cannot handle a Map type.
def withQueryParam(name: String, value: Any): ApiRequest[U] = copy[U](queryParams = queryParams + (name -> value))
This can be supported by the inclusion of;
def withQueryParam(values: Map[String, Any]): ApiRequest[U] = copy[U](queryParams = queryParams ++ values)
A full solution has been raised as PR #8610.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Scala Akka client's withQueryParam entry point and the supplied OpenAPI declaration for an object query parameter. Compare the generated request handling with PR #8610 and verify that arbitrary Map[String, Any] query values are supported without breaking ordinary parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100