Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13393
Closed
Open
Issue created Sep 09, 2022 by Administrator@rootContributor

[BUG][Java][resttemplate] Query param values not encoded anymore

Created by: Willem1987

Description

We are currently on OpenApi generator 5.4.0. Due to issues generating polymorphic classes we tried to upgrade to 6.0.1.

We are using a queryparam with a callback url of a string type currently. In version 5.4.0 the ApiClient had this line: if (value != null) { String templatizedKey = encodedName + valueItemCounter++; final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); uriParams.put(templatizedKey, encodedValue); queryBuilder.append('=').append("{").append(templatizedKey).append("}"); }

In 6.0.1 the code changed to: if (value != null) { String templatizedKey = encodedName + valueItemCounter++; uriParams.put(templatizedKey, value.toString()); queryBuilder.append('=').append("{").append(templatizedKey).append("}"); }

Without the encoding somehow our url changed from: /some-mock/api/1.0/endpoint/method?callbackUrl=http:/**/**other-service/servicename/api/1.0/endpoint/method to /some-mock/api/1.0/endpoint/method?callbackUrl=http:/other-service/servicename/api/1.0/endpoint/method

This is a problem because i don't think http:/ would be a valid url. Also it breaks our wiremock expects in integration tests.

openapi-generator version

6.0.1.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/11921 https://github.com/OpenAPITools/openapi-generator/pull/11922

It seems mentioned PR and issue changed the behavior, but i am unsure as to how i should restore our application with this.

Assignee
Assign to
Time tracking