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

OpenAPI Viewer #20852

Open
silverwind opened this issue Aug 18, 2022 · 7 comments · May be fixed by #26802
Open

OpenAPI Viewer #20852

silverwind opened this issue Aug 18, 2022 · 7 comments · May be fixed by #26802
Labels
topic/ui Change the appearance of the Gitea UI type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@silverwind
Copy link
Member

silverwind commented Aug 18, 2022

Feature Description

GitLab has a feature where they can render openapi/swagger documents using swagger-ui in a rendered view. We should consider adding this too as we already bundle swagger-ui, so it's a almost-zero cost addition.

GitLab can render OpenAPI specification files. The filename must include openapi or swagger and the extension must be yaml, yml, or json

@silverwind silverwind added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. topic/ui Change the appearance of the Gitea UI labels Aug 18, 2022
@silverwind silverwind changed the title Openapi Viewer OpenAPI Viewer Aug 18, 2022
@matteobassan
Copy link

Yes, it would be nice! I am currently trying to switch to Gitea from Gitlab and this has been missing from my list

@lunny
Copy link
Member

lunny commented Sep 15, 2022

Since iframe will be introduced in #20180, this becomes possible.

@silverwind
Copy link
Member Author

Probably good to iframe it, yes.

@silverwind
Copy link
Member Author

silverwind commented Sep 15, 2022

Thought, we could also do without backend support and just create the iframe in JS, like already done for mermaid:

const iframe = document.createElement('iframe');

@lafriks
Copy link
Member

lafriks commented Sep 15, 2022

While swagger ui would not introduce new dependencies I would rather see redoc being used for this as looks way better and readable

@silverwind
Copy link
Member Author

silverwind commented Sep 15, 2022

I find swagger-ui more readable than redoc, but that's probably because I'm used to it. To me, swagger-ui is still kind of the gold standard for openapi specs.

According to https://www.wappalyzer.com/compare/redoc-vs-swagger-ui, swagger ui is more than 12 times more popular than redoc.

@lafriks
Copy link
Member

lafriks commented Sep 15, 2022

I agree for swagger ui being better when you want it to be deployed with API where you can try it etc but in this case when it's only documentation display redoc has multiple advantages over swagger-ui like better display on mobile devices, easier to read nested structure documentation, better support for openapi 3 (like oneof that swagger-ui does not even support etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ui Change the appearance of the Gitea UI type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
4 participants