Query values are split at literal commas or lost when arrays are used · Issue #3623 · OpenFeign/feign · GitHub
Skip to content

Query values are split at literal commas or lost when arrays are used #3623

Open

Description

@hutiefang76

Three query-value paths change or lose the caller's values on current master (e32547ac):

  • A literal @RequestLine("GET /x?ids=1,2") becomes ?ids=1&ids=2, changing one value into two parameters. A percent-encoded comma would be fine; repeated parameters are the problem. Collection expressions should still expand as before.
  • @QueryMap with Map.of("ids", new int[]{1, 2}) sends an array identity such as ids=%5BI%40.... The same happens for primitive-array fields of query-map DTOs. String[] values in a query map already work.
  • @RequestLine("GET /x?ids={ids}") with @Param("ids") int[] also sends the array identity; @Param String[] is affected too. This is a separate expression-expansion path from the query-map case.

I reproduced these with a recording Client and ran the regression tests using the dev profile (Java 8 main compilation and a JDK 27 test JVM). I'll prepare a focused fix with collection, scalar, empty/null-array and reserved-character controls. Existing custom Param.Expander behavior will be preserved.

The inherited-field collision candidate is outside this scope; it needs a separate decision about name precedence. No changes to #3613 or #3612 are intended.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions