OpenAPITools / OpenAPITools/openapi-generator

[BUG][JAVA] Query param '$select' is URL encoded twice as '%2524select' instead of '%24select'

Open
#17,974 2 comments 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

Consuming the getTransactions method with a $select param with value "foo" results in a client calling something like

/transtactions%2524select=foo

instead of

/transtactions%24select=foo

openapi-generator version

7.3.0

OpenAPI declaration file content or url
{
  "openapi": "3.0.1",
  "info": {
    "title": "Test",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://some-url"
    }
  ],
  "paths": {
    "/transactions": {
      "get": {
        "tags": [
          "transactions"
        ],
        "operationId": "getAlltransactions",
        "parameters": [
          {
            "name": "$select",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "transactions response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
Generation Details

Java - Resttemplate

Steps to reproduce
Related issues/PRs
Suggest a fix

The query params should not be URL encoded twice.
The expected result is

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 Java Resttemplate generation using the supplied OpenAPI declaration and inspect how the $select query parameter becomes part of the request URL. Confirm the generated client sends %24select rather than %2524select, and add or update coverage for this declaration if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.