-
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 multiple Path annotations #1870
Conversation
Test looks good to me. 👍 |
Codecov Report
@@ Coverage Diff @@
## master #1870 +/- ##
============================================
+ Coverage 73.59% 73.61% +0.01%
- Complexity 9589 9601 +12
============================================
Files 838 838
Lines 36944 36985 +41
Branches 4554 4555 +1
============================================
+ Hits 27190 27227 +37
Misses 7429 7429
- Partials 2325 2329 +4
Continue to review full report at Codecov.
|
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
How's it going? Just let us know if you have any questions working on this. 😉 |
2a7e1b5
to
56dbfb1
Compare
Please let us know once this pull request is ready for reviews. |
I saw your comment late :P Yep:) I'll remove the WIP label and add a comment when ready |
8d1f791
to
c4e08b7
Compare
Fixes: #1822 (just for link) |
e93974d
to
781d06a
Compare
@jrhee17 Thanks a lot for coming back! Is it now ready for reviews? |
Hi :D . I think overall this is good to go, but let me clean up code/add some documentation/add tests before asking for review. I'll leave a comment when ready |
781d06a
to
d02effe
Compare
d02effe
to
004cb49
Compare
I think this PR is (finally) ready for review now~ :-) |
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceBuilderTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactoryTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceBuilderTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
4814559
to
68f12e4
Compare
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
...rc/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpDocServicePluginTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceBuilderTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceBuilderTest.java
Show resolved
Hide resolved
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactoryTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/server/docs/ServiceInfoTest.java
Outdated
Show resolved
Hide resolved
7e0ea70
to
48d9bed
Compare
48d9bed
to
042691a
Compare
.../src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceBuilderTest.java
Show resolved
Hide resolved
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.
Excellent work, @jrhee17! 👍
4c76bdd
to
49bfafd
Compare
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.
Left some nits. Thanks a lot @jrhee17!
core/src/test/java/com/linecorp/armeria/server/docs/ServiceInfoTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/server/docs/ServiceInfoTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceTest.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
@@ -79,14 +79,12 @@ function removeBrackets(headers: string): string { | |||
return headers.substring(1, length - 1).trim(); | |||
} | |||
|
|||
function isExactPathMapping(method: Method): boolean { | |||
function isSingleExactPathMapping(method: Method): boolean { |
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.
We use this value to display different forms in doc service.
If this is true
, HttpQueryString
shows up. If not, EndpointPath
shows up.
When multiple paths are specified, we should display EndpointPath
to get a whole path from the user.
So this is the right way to achieve the behavior at the moment. But when we implement this, we should reconsider this behavior. Just left a comment for the remind. 😄
core/src/main/java/com/linecorp/armeria/server/docs/ServiceInfo.java
Outdated
Show resolved
Hide resolved
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.
Thanks a lot, @jrhee17!
You are the best. 👍
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.
Thanks, @jrhee17 This is awesome work 👍👍
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
Outdated
Show resolved
Hide resolved
4663ab4
to
84bbda3
Compare
Thanks a lot, @jrhee17! 🙇 |
Motivation:
A user might want to specify multiple paths for annotated http services.
Modification:
@Path
annotation.AnnotatedHttpService
is created for each(httpMethod, pathMapping)
AnnotatedHttpService
becauseAnnotatedValueResolver
may be differenthttpMethod
s that have the samepathMapping
using a singleAnnotatedHttpService
at the cost of code complexiyMethodInfo
endpoints with same (httpMethod
,methodName
)AnnotatedHttpService
are not displayed in docs. I'm thinking this can be tackled in a separate PR.Breaking change in path declaration behavior
AS-IS
TO-BE