[BUG] Spring SDK sends List and array query parameters as a single string
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Comienza por RequestParamParameterProcessor.processArgument en shenyu-sdk/shenyu-sdk-spring/src/main/java/org/apache/shenyu/sdk/spring/annotation/RequestParamParameterProcessor.java, donde los argumentos de tipo lista y array se convierten con String.valueOf. Revisa las pruebas del Spring SDK y añade cobertura de regresión para parámetros de consulta repetidos, incluidos caracteres especiales y el caso C++. La corrección estará completa cuando cada elemento de lista o array se envíe con el mismo nombre de parámetro y se conserve la respuesta esperada del endpoint.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 8.9k
- Forks
- 3.1k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 128
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/shenyu
-
[BUG] Spring SDK returns null for successful plain-text String responsesPosiblemente ocupada @Chrisp12138 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
[BUG] Sliding-window rate limiter ignores requestCount and over-reports remaining requestsPosiblemente ocupada @konlue la tomó hace 17 días. Abiertotype: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
apache/shenyu#8442 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
[BUG] Boolean tars parameter parsed via Byte.valueOf → NumberFormatExceptionPosiblemente ocupada @yangjj-iso la tomó hace 43 días. Abiertoplugin: tars priority: medium type: bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
apache/shenyu#6736 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
admin: permission priority: medium type: bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
apache/shenyu#6549 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/shenyu
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
quelea-projection/Quelea#749 ·
Los mantenedores suelen responder en 1 día
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
erkamyaman/rust-anything#963 ·
Los mantenedores suelen responder en 1 día
-
api-diagnostics bug jdbc
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ClickHouse/clickhouse-java#3464 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 76/100
-
Deferred
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Sanne/incus-spawn#2768 ·
Los mantenedores suelen responder en 1 día