Skip to content
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

feat: support swagger UI to viewing API #1880

Merged
merged 1 commit into from
May 16, 2022

Conversation

wangyao2016
Copy link
Contributor

Detail descrition for this feature please check #1879

We can view swagger UI by /swagger-ui/index.html like:
http://127.0.0.1:8080/swagger-ui/index.html

image

@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #1880 (14bab30) into master (bb88c36) will increase coverage by 4.05%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1880      +/-   ##
============================================
+ Coverage     66.89%   70.94%   +4.05%     
- Complexity      728      982     +254     
============================================
  Files           449      449              
  Lines         38116    38119       +3     
  Branches       5404     5404              
============================================
+ Hits          25496    27043    +1547     
+ Misses        10104     8429    -1675     
- Partials       2516     2647     +131     
Impacted Files Coverage Δ
...n/java/com/baidu/hugegraph/api/auth/AccessAPI.java 0.00% <ø> (ø)
...n/java/com/baidu/hugegraph/api/auth/BelongAPI.java 0.00% <ø> (ø)
...in/java/com/baidu/hugegraph/api/auth/GroupAPI.java 0.00% <ø> (ø)
...in/java/com/baidu/hugegraph/api/auth/LoginAPI.java 74.28% <ø> (ø)
.../java/com/baidu/hugegraph/api/auth/ProjectAPI.java 82.05% <ø> (ø)
...n/java/com/baidu/hugegraph/api/auth/TargetAPI.java 0.00% <ø> (ø)
...ain/java/com/baidu/hugegraph/api/auth/UserAPI.java 75.80% <ø> (ø)
...om/baidu/hugegraph/api/filter/ExceptionFilter.java 56.73% <ø> (ø)
...in/java/com/baidu/hugegraph/api/graph/EdgeAPI.java 63.07% <ø> (ø)
.../java/com/baidu/hugegraph/api/graph/VertexAPI.java 35.67% <ø> (ø)
... and 96 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb88c36...14bab30. Read the comment docs.

Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for your contribution, some tiny comments

Comment on lines 69 to 72
//load for swagger ui
this.httpServer.getServerConfiguration().addHttpHandler(
new StaticHttpHandler(
"swagger-ui"), "/swagger-ui");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot it, thanks

@@ -65,6 +66,10 @@ public void start() throws IOException {

this.httpServer = this.configHttpServer(uri, rc);
try {
//load for swagger ui
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"// Register swagger-ui http handler"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Linary
Linary previously approved these changes May 15, 2022
javeme
javeme previously approved these changes May 15, 2022
@wangyao2016 wangyao2016 dismissed stale reviews from javeme and Linary via 975e907 May 16, 2022 02:31
@javeme
Copy link
Contributor

javeme commented May 16, 2022

@wangyao2016 could you please describe the diff since last review?

@wangyao2016
Copy link
Contributor Author

@javeme Thank you for reviewing in time.

To facilitate version maintenance, use the same variable to maintain the version.

image

image

description = "All management API for HugeGraph",
contact =
@Contact(
url = "https://github.com/apache/incubator-hugegraph",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use this address https://github.com/apache/hugegraph and it will be automatically redirected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
image

Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@wangyao2016 tips: in order to diff the changes we need to use git commit instead of git commit --amend as possible

@imbajin imbajin linked an issue May 16, 2022 that may be closed by this pull request
@imbajin
Copy link
Member

imbajin commented May 16, 2022

image

rerun failed ci & rocksdb's ci failed frequently in each pr

@javeme javeme merged commit 335f0ea into apache:master May 16, 2022
@seagle-yuan
Copy link
Contributor

@wangyao2016 could you run

mvn checkstyle:checkstyle 

and deal with code to conform with the specifications

https://github.com/apache/incubator-hugegraph-doc/wiki/HugeGraph%E4%BB%A3%E7%A0%81%E9%A3%8E%E6%A0%BC%E6%8C%87%E5%8D%97

@wangyao2016
Copy link
Contributor Author

@seagle-yuan Sure. First of all, make sure you mean these unused imports?
image

@seagle-yuan
Copy link
Contributor

yeah, this is just a case, suggest you deal with all the code that you coded

@wangyao2016
Copy link
Contributor Author

yeah, this is just a case, suggest you deal with all the code that you coded

I've done it. But just found these unused imports. Can you give me a screenshot?
Thanks.

@JackyYangPassion
Copy link
Contributor

JackyYangPassion commented Jul 6, 2022

perfect feature

@imbajin
Copy link
Member

imbajin commented Jan 11, 2023

@wangyao2016 Excuse me, wonder to know the could html/js files related to swagger generated by building?

like use execute mvn package/install to generate them rather than include them as a source file?

Contact me directly when free, thanks a lot 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] support swagger UI to viewing API
7 participants