swagger-api / swagger-api/swagger-codegen

[JAVA] Bug swagger don't encode Germany character in query params

Open
#10,474 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

The query parameter contain Germany character (more specific, the character ß) is not encoded when we send the request

Swagger-codegen version

3.0.20

Command line used for generation

I am using io.swagger.codegen.v3:swagger-codegen-maven-plugin

Related issues/PRs

https://github.com/swagger-api/swagger-codegen/pull/8880
https://github.com/swagger-api/swagger-codegen/pull/9387

Suggest a fix/enhancement

I checked the method ApiClient#invokeAPI that we currently don't use the encode feature of UriComponentsBuilder or RestTemplate but use ti from method toUri(). At my glance there, the method is just encode the character under ISO control. And it looks like Germany character is not a part of it

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 at the Java ApiClient#invokeAPI method and inspect how UriComponentsBuilder or RestTemplate constructs and encodes query parameters. Review related PRs 8880 and 9387 for context. Done means a query parameter containing ß is correctly encoded in the generated request.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.