-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for HTTP GET map parameters #6072
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI, @kwondh5217, thanks for the PR. 😉
Would you add an e2e test that verifies if this change works?
GET http://127.0.0.1:xxx/map?a=b&c=d
@Get("/map")
public HttpResponse map(@Params Map<String, Object> map) {...}
Signed-off-by: Daeho Kwon <trewq231@naver.com>
@minwoox Thanks for your comment! |
Signed-off-by: Daeho Kwon <trewq231@naver.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically looks good. Left just nits. 👍
core/src/test/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceTest.java
Outdated
Show resolved
Hide resolved
...rc/test/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolverTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
@minwoox ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, @kwondh5217! 😄
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
Outdated
Show resolved
Hide resolved
Co-authored-by: minux <songmw725@gmail.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
# Conflicts: # core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
Show resolved
Hide resolved
Signed-off-by: Daeho Kwon <trewq231@naver.com>
@jrhee17 ! |
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Motivation:
This pull request addresses #6058
Currently,
@Param
cannot be mapped to a Map, but this change enables that functionality, allowing query parameters to be handled as a Map.Modifications:
AnnotatedValueResolver
to detect when a parameter is of type Map and the@Param
annotation has an unspecified value.@Param
value is explicitly specified.ofQueryParamMap
to handle the creation of an AnnotatedValueResolver for mapping all query parameters into a Map.@Param
value is unspecified and the parameter type is Map.Result:
@Param
asMap<String, Object>
to handle all query parameters.