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

Swagger documentation #42

Merged
merged 4 commits into from
Aug 26, 2023
Merged

Conversation

waterflow80
Copy link
Collaborator

@waterflow80 waterflow80 commented Aug 24, 2023

closes #38
Documented the API with swagger v3: Implementation: springdoc-openapi-ui, and added request redirects for the swagger page. So each of the following endpoints will redirect to the swagger home page:

  • http://localhost:8081/eva/webservices/seqcol/
  • http://localhost:8081/eva/webservices/seqcol/collection
  • http://localhost:8081/eva/webservices/seqcol/comparison
  • http://localhost:8081/eva/webservices/seqcol/seqcol-documentation
  • http://localhost:8081/eva/webservices/seqcol/swagger-ui/index.html

The reason why we chose swagger v3 over v2, is that version 2 had a lot of conflicts and problems with spring boot 2.7.x (our version) and it seemed like it is not supported. Here are some discussions about the issues I've been struggling with:

Some enhancements have been done in swagger v3 (OpenAPI 3) so I don't think there's gonna be an issue in using it to document our API.

A screenshot of the swagger page:
Screenshot from 2023-08-24 19-01-28

Comment on lines 50 to 54
description = "The desired output's level",
example = "1 or 2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would do it this way, as I think the UI uses the example values to auto-fill sample requests.

Suggested change
description = "The desired output's level",
example = "1 or 2",
description = "The desired output's level (1 or 2)",
example = "1",

"objects, a service for the retrieval of seqCol objects given their " +
"level 0 digests and a service for the comparison of two seqCol objects.")
.version("v1.0")
.license(new License().name("Apache-2.0").url("https://raw.githubusercontent.com/EBIvariation/contig-alias/master/LICENSE"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.license(new License().name("Apache-2.0").url("https://raw.githubusercontent.com/EBIvariation/contig-alias/master/LICENSE"))
.license(new License().name("Apache-2.0").url("https://raw.githubusercontent.com/EBIvariation/eva-seqcol/main/LICENSE"))

@waterflow80 waterflow80 merged commit a78f577 into EBIvariation:main Aug 26, 2023
1 check passed
@waterflow80 waterflow80 deleted the swagger-docs branch October 20, 2023 21:24
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.

Create swagger page
3 participants