OpenAPITools / OpenAPITools/openapi-generator

[BUG] [scala-akka-client] Scala Akka client does not support arbitrary query string values

Open
#8,606 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.