Skip to content

[BUG] [Kotlin] Query parameters are surrounded by braces in 7.18.0 and revert helps #22590

@pkubowicz

Description

@pkubowicz

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Passing of query parameter values is completely broken in 7.18.0.

  • expected: /login?username=myUsername&password=myPassword
  • actual: /login?username=%5BmyUsername%5D&password=%5BmyPassword%5D

So username=[myUsername] (values are treated as single-element lists before doing 'toString').

openapi-generator version

Worked in 7.17.0, broken in 7.18.0

OpenAPI declaration file content or url
Generation Details
Steps to reproduce

Run the test I submitted in #22588 against code from 7.18.0.

In case you think 'this is a problem with how the test constructs URLs, this does not mean URLs are broken when the normal tech stack is used': I found the issue by examining how real code executed on production. URLs were exactly like showed by the test (i.e., extra [ and ] added).

Related issues/PRs

Regression caused by #22512 (reverting it solves the issue)

Suggest a fix

Revert #22512 and afterwards merge #22588 to have a regression test.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions