-
Notifications
You must be signed in to change notification settings - Fork 307
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
[AMORO-3256] Amoro Open Api with Swagger in Ams #3296
Conversation
@@ -408,6 +409,66 @@ | |||
<scope>test</scope> | |||
</dependency> | |||
|
|||
<dependency> |
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 can use ${swagger.version} replace 2.2.10
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.
Yes, we may define the versions in properties.
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.
Thank you for your suggestion. I have removed that part of the dependency.
amoro-ams/pom.xml
Outdated
|
||
<plugin> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>openapi-generator-maven-plugin</artifactId> |
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.
the latest version is 7.9.0 why we don't use it?
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.
the latest version is 7.9.0 why we don't use it?
Thank you for your suggestion. The latest version has dependency conflicts, and I believe the current version should be stable enough to meet the requirements.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3296 +/- ##
============================================
- Coverage 30.17% 21.60% -8.57%
+ Complexity 3840 2311 -1529
============================================
Files 580 426 -154
Lines 48020 39719 -8301
Branches 6207 5623 -584
============================================
- Hits 14488 8582 -5906
+ Misses 32542 30409 -2133
+ Partials 990 728 -262
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
@mansonliwh Thanks for the contribution! I left some comments.
amoro-ams/pom.xml
Outdated
@@ -35,6 +35,7 @@ | |||
<url>https://amoro.apache.org</url> | |||
|
|||
<properties> | |||
<skip-generate-sdk>false</skip-generate-sdk> |
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.
IMO, we should not generate the SDK by default as it is not required for everyone.
But the doc is necessary for the dashboard.
So we may need to separate the properties for SDK and DOC.
@@ -408,6 +409,66 @@ | |||
<scope>test</scope> | |||
</dependency> | |||
|
|||
<dependency> |
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.
Yes, we may define the versions in properties.
amoro-ams/pom.xml
Outdated
<version>2.2.10</version> | ||
</dependency> | ||
|
||
<dependency> |
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.
Do we need the dependency by default?
Or should we separate them for the doc and the SDK?
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.
Do we need the dependency by default? Or should we separate them for the doc and the SDK?
Thank you for your suggestion. I have already enabled the default 'skip' option while separated the 'doc' and the 'sdk'.
amoro-ams/pom.xml
Outdated
<version>4.1.1</version> | ||
</dependency> | ||
|
||
<dependency> |
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 already had httpclient:5.2 and httpcore:5.2 dependencies in runtime scope, do we still need this?
2e4fa1d
to
ae5b371
Compare
ae5b371
to
b169a1f
Compare
ae5b21e
to
b136b28
Compare
mounted() { | ||
SwaggerUI({ | ||
dom_id: '#swagger-ui', | ||
url: '/swagger-docs', // 这里是你的 OpenAPI 规范文件的路径 |
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.
Comments should be English.
b136b28
to
97f4ee5
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.
At present, we have no relevant descriptive documents for this section. Maybe we need to supplement them.
cbd34de
to
49a35cf
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.
LGTM
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.
@mansonliwh I left some comments, PTAL.
fd62196
to
0c7516a
Compare
f740008
to
e972fc1
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.
LGTM.
Thanks for the contribution!
Why are the changes needed?
Close #3256.
Brief change log
This PR introduces Swagger and OpenAPI Generator. To avoid intrusive development, this design does not use a large number of annotations on the controller. Instead, it predefines the openapi.yaml. The interface specifications defined in openapi.yaml are used to generate the Swagger page, API docs, and an SDK using the Apache HttpClient framework.
In the Maven build, you can use the generate-sdk profile to specify whether to generate the SDK.
How was this patch tested?
Swagger Page:
Auth Setting:
Generated API docs & SDK demo: