Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Automatically generate Swagger documentation #184

Merged
merged 7 commits into from
May 8, 2020

Conversation

skdong
Copy link
Contributor

@skdong skdong commented May 5, 2020

[document] Swagger Rest API adoc (#150)(#176)

  • Add SwaggerConfig to activate Swagger documentation when mvn test
  • Add SwaggerJsonTest unit test for call Swagger API generating Swagger adoc documentation
  • Swagger adoc documentation generated under target/swagger directory

skdong added 4 commits April 30, 2020 18:04
2. Export Swagger json document through unit test, document directory /target/swagger/swagger.json
3. Convert Swagger json document to adoc document, document directory target / swagger / swagger.adoc
@xieus xieus requested review from xieus and kevin-zhonghao May 5, 2020 16:49
@xieus xieus added documentation Improvements or additions to documentation feature feature development labels May 5, 2020
@xieus xieus added this to the Version 0.5.2020.05.30 milestone May 5, 2020
@xieus xieus linked an issue May 5, 2020 that may be closed by this pull request
@xieus
Copy link
Contributor

xieus commented May 7, 2020

@skdong The PR description looks pretty comprehensive. We only need to run "mvn test" to create the swagger adoc which will be generated under target/swagger directory, is that correct?

Also, do we still need the other PR #177?

@skdong
Copy link
Contributor Author

skdong commented May 7, 2020

@xieus yes We only need to run "mvn test" to create swagger adoc

@skdong
Copy link
Contributor Author

skdong commented May 7, 2020

@xieus This PR generates a Swagger adoc. Swagger generates documents through Spring Controller. PR # 177 generates adoc for each unit test. There is no corresponding Spring Controller for apigateway type api. It needs to be generated for unit test

@xieus
Copy link
Contributor

xieus commented May 7, 2020

@skdong Thanks for the response. I just tried to run "mvn test" in the swagger-auto branch, I didn't find the target/swagger sub-directory showed up. Something I might have missed?

@skdong
Copy link
Contributor Author

skdong commented May 7, 2020

@xieus This is because I turned off the unit test, the operation of generating the document was completed in a unit test, and now the unit test still depends on the database.

@skdong
Copy link
Contributor Author

skdong commented May 7, 2020

@xieus I can open the unit test and submit it, but It need to have a connectable database.

@xieus
Copy link
Contributor

xieus commented May 7, 2020

The Ignite UT issue is kind of headache. We will have to live without Ignite UTs until the issue is fixed. @chenpiaoping could you please take a look? This is becoming a blocking issue for us.

@xieus
Copy link
Contributor

xieus commented May 7, 2020

@skdong You should be unblocked. UTs are enabled (see PR #186)

@skdong
Copy link
Contributor Author

skdong commented May 8, 2020

@xieus Ok I will unblock it

@skdong
Copy link
Contributor Author

skdong commented May 8, 2020

@xieus I only activated Uts of route, subnet, vpc, these microservices are normal now. Mac and private IP UTs still have errors when executed

mac microservice tips com.futurewei.alcor.common.db.CacheFacotry confilicts with com.futurewei.alcor.common.service.CacheFacotry

Private ip microservice prompt Unable to connect to localhost: 6379

Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

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

LGTM.

@xieus
Copy link
Contributor

xieus commented May 8, 2020

@xieus I only activated Uts of route, subnet, vpc, these microservices are normal now. Mac and private IP UTs still have errors when executed

mac microservice tips com.futurewei.alcor.common.db.CacheFacotry confilicts with com.futurewei.alcor.common.service.CacheFacotry

Private ip microservice prompt Unable to connect to localhost: 6379

@skdong I think the current PR looks good, and the Mac Manager and IP Manager UTs error could be fixed by service owner.

@kimeunju108 please look into the Mac Manager UTs, and @chenpiaoping please look into the IP manager UTs.

@xieus xieus merged commit 2ae412f into futurewei-cloud:master May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation feature feature development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation] Auto-generated Spring REST doc
2 participants