swagger-api / swagger-api/swagger-codegen

[JAVA] Spring RestTemplate: Encode request URL not work

Open
#11,116 0 comments 0 reactions 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

https://github.com/swagger-api/swagger-codegen/pull/8880
this fix is not found in the master of v2

Swagger-codegen version

2.4.21

Suggest a fix/enhancement

change from:
final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().toUri());
to:
final BodyBuilder requestBuilder = RequestEntity.method(method, builder.build().encode().toUri());

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 RestTemplate request construction using RequestEntity.method and UriComponentsBuilder, then compare the referenced pull request 8880. Done means the request URL is encoded before conversion to a URI and the generated client handles encoded request URLs correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.