-
Notifications
You must be signed in to change notification settings - Fork 919
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 markdown when using @Description Annotation #4304
Support markdown when using @Description Annotation #4304
Conversation
0c273bf
to
6e39005
Compare
Codecov Report
@@ Coverage Diff @@
## master #4304 +/- ##
============================================
- Coverage 73.57% 73.52% -0.06%
- Complexity 17654 17665 +11
============================================
Files 1500 1504 +4
Lines 65991 66094 +103
Branches 8325 8335 +10
============================================
+ Hits 48555 48597 +42
- Misses 13236 13287 +51
- Partials 4200 4210 +10
Continue to review full report at Codecov.
|
4e288f2
to
b76cd63
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.
This looks really amazing. Thanks a lot, @cnabro! 😄
Do you mind adding test cases of ResponseObject
and Description
to Java test class especially to AnnotatedDocServiceTest
?
We use the class as a playground of DocService using the env value (DOC_SERVICE_DEMO
) so it would be very helpful if we can use it there. 😄
...src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedDocServicePlugin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/annotation/ResponseObject.java
Outdated
Show resolved
Hide resolved
@minwoox ok, i'll try it. Thanks for the review ! 👍 |
...src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedDocServicePlugin.java
Outdated
Show resolved
Hide resolved
92163ad
to
e89486d
Compare
@minwoox I think worth supporting markdown in the parameter description as well 😅 |
Oops, I didn't know that we had such a bug. 😓
Then which one do you want to use instead? Could you tell me more about this, please? 😄 |
@minwoox <TableContainer> // wrapping table
<Table>
<TableHead>
<TableRow>
<TableCell>Name</TableCell>
{hasLocation && <TableCell>Location</TableCell>}
<TableCell>Required</TableCell>
<TableCell>Type</TableCell>
<TableCell>Description</TableCell>
{hasBean && <TableCell />}
</TableRow>
</TableHead>
<TableBody>
<FieldInfos
hasLocation={hasLocation}
indent={0}
title={title}
variables={variables}
specification={specification}
/>
</TableBody>
</Table>
</TableContainer> How about fixing the issue like this screenshot using scroll? |
That looks awesome. 😆 |
Had a chat with @trustin and how about adding a metadata to @Description(value= "...", markup = Markup.NONE)
@Description(value= "...", markup = Markup.MARKDOWN)
@Description(value= "...", markup = Markup.MERMAID) // we can add this later. |
@minwoox Good idea. It will be used for various purposes. 👍 |
aa1edeb
to
ea2e4f6
Compare
….java Co-authored-by: jrhee17 <[email protected]>
…tion/AnnotatedDocServiceTest.java Co-authored-by: jrhee17 <[email protected]>
...src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedDocServicePlugin.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedDocServicePlugin.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/annotation/DescriptionInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/annotation/DescriptionInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/annotation/Markup.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java
Outdated
Show resolved
Hide resolved
…tion/AnnotatedDocServicePlugin.java Co-authored-by: Ikhun Um <[email protected]>
…tion/AnnotatedDocServicePlugin.java Co-authored-by: Ikhun Um <[email protected]>
…riptionInfo.java Co-authored-by: Ikhun Um <[email protected]>
Co-authored-by: Ikhun Um <[email protected]>
Co-authored-by: Ikhun Um <[email protected]>
…nfo.java Co-authored-by: Ikhun Um <[email protected]>
….java Co-authored-by: Ikhun Um <[email protected]>
…tion/AnnotatedDocServiceTest.java Co-authored-by: Ikhun Um <[email protected]>
Co-authored-by: Ikhun Um <[email protected]>
…riptionInfo.java Co-authored-by: Ikhun Um <[email protected]>
….java Co-authored-by: Ikhun Um <[email protected]>
…ription.java Co-authored-by: Ikhun Um <[email protected]>
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.
Awesome, @cnabro! 🚀💯
As you know, documentation service is the most beloved feature.
Many Armeria users will be happy with this.
core/src/main/java/com/linecorp/armeria/server/docs/Markup.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/DescriptionInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/docs/DescriptionInfo.java
Show resolved
Hide resolved
...ft0.13/src/main/java/com/linecorp/armeria/internal/server/thrift/ThriftDocServicePlugin.java
Show resolved
Hide resolved
@@ -145,7 +147,7 @@ public ServiceSpecification generateSpecification(Set<ServiceConfig> serviceConf | |||
return generate(serviceDescription, methodInfos); | |||
} | |||
|
|||
private static void addServiceDescription(Map<Class<?>, String> serviceDescription, | |||
private static void addServiceDescription(Map<Class<?>, DescriptionInfo> serviceDescription, |
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.
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.
OK. I'll wait for it 👍
Co-authored-by: Ikhun Um <[email protected]>
…nInfo.java Co-authored-by: Ikhun Um <[email protected]>
Co-authored-by: Ikhun Um <[email protected]>
…nInfo.java Co-authored-by: Ikhun Um <[email protected]>
Thanks a lot for your hard work! ❤️ |
Motivation:
Modifications:
Provide a way to improve
DocService
for annotated service #4299 (comment)Support varius markup
Support enums documentation in annotated service.
Support return types documentation in annotated service using annotation.Add@ResponseObject
to specify which element should be converted to structs inDocService
byAnnotatedDocServicePlugin
Need to be exclude default class likeHttpResponse
..StructInfo
for various types #4309, it will be fixed usingStructInfoProvider
Show path mappings in
Services
Update Armeria Reference doc : https://armeria.dev/docs/server-docservice/
<img width=1681" alt="image" src="https://user-images.githubusercontent.com/6916639/174469675-daa21c8a-6fd3-40c0-bd78-0c538bdfcf0c.png">
Result:
DocService
for annotated service #4299, The return type of annotated service does not show anything in DocService #2200]