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

docs: Add Swagger UI to the API reference page #10923

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

changhc
Copy link
Contributor

@changhc changhc commented Apr 15, 2023

Description

Currently the link in the API reference page points to the API spec in JSON, which is not readable. This PR adds a simple HTML code snippet that renders Swagger UI with the spec to swagger.md so that it displays the API docs directly.

We can also put the HTML code in a separate file and simply make the link in the API reference page point to that file. I think it's more straightforward to embed Swagger UI like this.

One issue with Swagger UI is that it's slow when it loads information about a certain path or schema after a user clicks on it. This is probably because the API spec is too large. I tested generating Swagger UI in static HTML, but it also took some time for my browser to load a certain path.

Test

make docs

Though I also updated Makefile to exempt swagger.md from checks because it has HTML code, which is not allowed by the linter.

Screenshot

Peek 2023-04-15 10-31

Signed-off-by: Huan-Cheng Chang <[email protected]>
@changhc changhc marked this pull request as ready for review April 15, 2023 10:30
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Thanks!

@terrytangyuan terrytangyuan merged commit 36f65ec into argoproj:master Apr 15, 2023
@changhc changhc deleted the api-ref branch April 15, 2023 13:39
JPZ13 pushed a commit to pipekit/argo-workflows that referenced this pull request Jul 4, 2023
@agilgur5 agilgur5 added the area/docs Incorrect, missing, or mistakes in docs label Jan 14, 2024
agilgur5 pushed a commit that referenced this pull request Jun 17, 2024
@argoproj argoproj locked as resolved and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Incorrect, missing, or mistakes in docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants