[BUG] Spring SDK sends List and array query parameters as a single string
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
調査の方向性
shenyu-sdk/shenyu-sdk-spring/src/main/java/org/apache/shenyu/sdk/spring/annotation/RequestParamParameterProcessor.java の RequestParamParameterProcessor.processArgument から始めます。ここでは、リスト引数と配列引数が String.valueOf で変換されます。Spring SDK のテストを確認し、特殊文字や C++ の場合を含む、繰り返しクエリパラメータの回帰カバレッジを追加してください。各リスト要素または配列要素が同じパラメータ名で送信され、期待されるエンドポイントのレスポンスが保持された時点で修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
A named @RequestParam in the ShenYu Spring SDK sends a list as one query value containing the Java list’s string representation. A String[] is also sent as one value, with a Java object string such as [Ljava.lang.String;@....
Expected Behavior
I expected one query value per element under the same name. For example, List.of("red", "blue") should be sent as ?tag=red&tag=blue.
Steps To Reproduce
Point a ShenYu Spring client at a Spring MVC endpoint with these declarations:
@ShenyuClient(name = "colors")
public interface ColorsClient {
@GetMapping("/colors")
ShenyuResponse colors(@RequestParam("tag") List<String> tags);
}
@RestController
public class ColorsController {
@GetMapping("/colors")
public String colors(@RequestParam("tag") List<String> tags) {
return String.join("|", tags);
}
}
Call client.colors(List.of("red", "north & south=east", "茶", "red", "C++")). The endpoint returned HTTP 200, but the response body was [red|north & south=east|茶|red|C ] (two spaces after C). I expected red|north & south=east|茶|red|C++.
Environment
ShenYu master (`7c08840`), JDK 21, Apache HttpClient transport, Spring MVC 6.2.19.
Debug logs
No response
Anything else?
In RequestParamParameterProcessor.processArgument, the list or array is stored as one value, then passed to String.valueOf before URL encoding.
Is it OK to make repeated parameters the default for lists and arrays, or should the SDK preserve the old format for endpoints that expect one value? If repeated parameters are the intended behavior, I’ll submit the fix with regression tests.
- 主要言語
- Java
- スター
- 8.9k
- フォーク
- 3.1k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 128
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/shenyu のほかの issue
-
[BUG] Spring SDK returns null for successful plain-text String responses対応中かも @Chrisp12138 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Sliding-window rate limiter ignores requestCount and over-reports remaining requests対応中かも @konlue が 17 日前に担当しました。 オープンtype: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
apache/shenyu#8442 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Boolean tars parameter parsed via Byte.valueOf → NumberFormatException対応中かも @yangjj-iso が 43 日前に担当しました。 オープンplugin: tars priority: medium type: bug
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
apache/shenyu#6736 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
admin: permission priority: medium type: bug
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
apache/shenyu#6549 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
quelea-projection/Quelea#749 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
erkamyaman/rust-anything#963 ·
メンテナーはふだん 1 日以内に返信
-
api-diagnostics bug jdbc
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ClickHouse/clickhouse-java#3464 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 76/100
-
Deferred
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Sanne/incus-spawn#2768 ·
メンテナーはふだん 1 日以内に返信