-
Notifications
You must be signed in to change notification settings - Fork 935
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
Conversation
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) {...}
@minwoox Thanks for your comment! |
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
@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
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java
Show resolved
Hide resolved
@jrhee17 ! |
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Signed-off-by: Daeho Kwon <trewq231@naver.com>
Nice work, @kwondh5217! 👏 👏 👏 |
@minwoox Thanks! 😄 |
@kwondh5217 I can't wait to see that. 😆 |
Hi @minwoox , |
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.