Conversation
28bc91d to
eac6431
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5547 +/- ##
============================================
+ Coverage 73.95% 74.11% +0.16%
- Complexity 20115 21019 +904
============================================
Files 1730 1819 +89
Lines 74161 77418 +3257
Branches 9465 9891 +426
============================================
+ Hits 54847 57380 +2533
- Misses 14837 15385 +548
- Partials 4477 4653 +176 ☔ View full report in Codecov by Sentry. |
trustin
left a comment
There was a problem hiding this comment.
Good start! Looking forward to the update 🙇
52f3f53 to
2801cdd
Compare
3e809c7 to
889d887
Compare
126284b to
42ef9a2
Compare
trustin
left a comment
There was a problem hiding this comment.
Could you fix all lint errors?
trustin
left a comment
There was a problem hiding this comment.
I think we're pretty close again, now. Thanks a lot for your patience, @chickenchickenlove! 🙇
…tion/AnnotatedValueResolver.java Co-authored-by: Trustin Lee <[email protected]>
…tion/AnnotatedValueResolver.java Co-authored-by: Trustin Lee <[email protected]>
…tion/AnnotatedValueResolverTest.java Co-authored-by: Trustin Lee <[email protected]>
| if (targetType.isPrimitive()) { | ||
| targetType = Primitives.wrap(targetType); | ||
| } |
There was a problem hiding this comment.
Micro optimization) Should we do this when rawType is created to avoid additional costs?
There was a problem hiding this comment.
You are right 👍
Using rawType might result in some additional costs due to Wrapping in all AnnotatedValueResolvers that do not use rawType. However, unnecessary calls will be made at most once during initialization, and afterwards, it could save on the cost of Wrapping with each incoming user request.
…ibute.java Co-authored-by: Ikhun Um <[email protected]>
|
Oops! Sorry but would you mind resolving the merge conflict, @chickenchickenlove ? |
|
Thanks a lot for updating the PR description and resolving the merge conflict, @chickenchickenlove! 🙇🙇🙇 |
### Motivation: - In the past, users could get a value from `ServiceRequestContext` by using `ServiceRequestContext.attr(key)`. however, if it were possible to inject values which in `ServiceRequestContext` into method parameters using any annotation, users would be able to use it more conveniently. ### Modifications: - New annotation. `@Attribute` is added. - Make new field `rawType` in `AnnotatedValueResolver` to validate type cast. - New methods `ofAttribute()` and `attributeResolver()` are added to `AnnotatedValueResolver` to get values from `ServiceRequestContext` and inject them method parameters. - `findName()` in `AnnotatedElementNameUtil` method have been merged into a single method. (refactoring for internal use) - Add test codes. - Add document explaining how to use the `@Attribute` annotation. ### Result: - Closes line#5514 - Users can inject values from the `ServiceRequestContext` into method parameters using the `@Attribute` annotation without `ServiceRequestContext.attr(key)`. --------- Co-authored-by: Trustin Lee <[email protected]> Co-authored-by: Ikhun Um <[email protected]> Co-authored-by: minux <[email protected]>
Motivation: We must not convert the header name specified in `@Header` when creating an annotated service. This is a regression introduced by #5547, affecting 1.29.0 through 1.29.3. Modifications: - Do not convert the header name specified in `@Header`. Result: - An annotated service that has a `@Header` with the specified name now works correctly.
Motivation: We must not convert the header name specified in `@Header` when creating an annotated service. This is a regression introduced by line#5547, affecting 1.29.0 through 1.29.3. Modifications: - Do not convert the header name specified in `@Header`. Result: - An annotated service that has a `@Header` with the specified name now works correctly.

Motivation:
ServiceRequestContextby usingServiceRequestContext.attr(key). however, if it were possible to inject values which inServiceRequestContextinto method parameters using any annotation, users would be able to use it more conveniently.Modifications:
@Attributeis added.rawTypeinAnnotatedValueResolverto validate type cast.ofAttribute()andattributeResolver()are added toAnnotatedValueResolverto get values fromServiceRequestContextand inject them method parameters.findName()inAnnotatedElementNameUtilmethod have been merged into a single method. (refactoring for internal use)@Attributeannotation.Result:
@Attributein annotated services #5514ServiceRequestContextinto method parameters using the@Attributeannotation withoutServiceRequestContext.attr(key).