OpenAPI Viewer #9423

Open
opened 2025-11-02 08:38:18 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @silverwind on GitHub (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

Originally created by @silverwind on GitHub (Aug 18, 2022). ### Feature Description GitLab has a [feature](https://docs.gitlab.com/ee/user/project/repository/#openapi-viewer) 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
GiteaMirror added the topic/content-renderingtype/proposaltype/featuretopic/ui labels 2025-11-02 08:38:18 -06:00
Author
Owner

@matteobassan commented on GitHub (Sep 15, 2022):

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

@matteobassan commented on GitHub (Sep 15, 2022): Yes, it would be nice! I am currently trying to switch to Gitea from Gitlab and this has been missing from my list
Author
Owner

@lunny commented on GitHub (Sep 15, 2022):

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

@lunny commented on GitHub (Sep 15, 2022): Since iframe will be introduced in #20180, this becomes possible.
Author
Owner

@silverwind commented on GitHub (Sep 15, 2022):

Probably good to iframe it, yes.

@silverwind commented on GitHub (Sep 15, 2022): Probably good to iframe it, yes.
Author
Owner

@silverwind commented on GitHub (Sep 15, 2022):

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

bf325d4412/web_src/js/markup/mermaid.js (L55)

@silverwind commented on GitHub (Sep 15, 2022): Thought, we could also do without backend support and just create the iframe in JS, like already done for mermaid: https://github.com/go-gitea/gitea/blob/bf325d44120c4a6fc7f67ff1dc25db770247c9a7/web_src/js/markup/mermaid.js#L55
Author
Owner

@lafriks commented on GitHub (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

@lafriks commented on GitHub (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
Author
Owner

@silverwind commented on GitHub (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.

@silverwind commented on GitHub (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.
Author
Owner

@lafriks commented on GitHub (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)

@lafriks commented on GitHub (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)
Author
Owner

@lunny commented on GitHub (Jul 6, 2025):

This could be an plugin after #34917 is implemented. We can use Scalar nowadays

@lunny commented on GitHub (Jul 6, 2025): This could be an plugin after #34917 is implemented. We can use Scalar nowadays
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9423