Question about swagger.json file #10114

Closed
opened 2025-11-02 08:58:30 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @sungam3r on GitHub (Jan 17, 2023).

Feature Description

Hi. I've read https://docs.gitea.io/en-us/faq/#what-is-swagger and I successfully can work with swagger UI on my running Gitea instance. I would like to ask how I can get swagger json file (Open API json document). I want to use NSwag to generate .NET REST client for Gitea. Example for Atlassian Bitbucket Server: https://developer.atlassian.com/server/bitbucket/8.6.swagger.v3.json

Screenshots

No response

Originally created by @sungam3r on GitHub (Jan 17, 2023). ### Feature Description Hi. I've read https://docs.gitea.io/en-us/faq/#what-is-swagger and I successfully can work with swagger UI on my running Gitea instance. I would like to ask how I can get swagger json file (Open API json document). I want to use NSwag to generate .NET REST client for Gitea. Example for Atlassian Bitbucket Server: https://developer.atlassian.com/server/bitbucket/8.6.swagger.v3.json ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 08:58:30 -06:00
Author
Owner

@jolheiser commented on GitHub (Jan 17, 2023):

For example, this is try's: https://try.gitea.io/swagger.v1.json

It looks like it may be outdated, but you could also take a look at https://github.com/mkloubert/gitea.net for reference.

@jolheiser commented on GitHub (Jan 17, 2023): For example, this is try's: https://try.gitea.io/swagger.v1.json It looks like it may be outdated, but you could also take a look at https://github.com/mkloubert/gitea.net for reference.
Author
Owner

@sungam3r commented on GitHub (Jan 17, 2023):

Thanks, https://try.gitea.io/swagger.v1.json works. Just to clarify - I would like to get Open API document from exact the same instance that I use, not from somewhere else. The reasons are :

  1. Guaranteed adherence of received specification to the runnin instance.
  2. Security considerations. Document should be taken from the internal network.

I tried to append swagger.v1.json to my host URL and it works. Thanks again.

@sungam3r commented on GitHub (Jan 17, 2023): Thanks, https://try.gitea.io/swagger.v1.json works. Just to clarify - I would like to get Open API document from exact the same instance that I use, not from somewhere else. The reasons are : 1) Guaranteed adherence of received specification to the runnin instance. 2) Security considerations. Document should be taken from the internal network. I tried to append swagger.v1.json to my host URL and it works. Thanks again.
Author
Owner

@jolheiser commented on GitHub (Jan 17, 2023):

That was why it was an example.
I didn't mean to suggest you use try instead of your instance. 😅

Glad you got it working! 👍

@jolheiser commented on GitHub (Jan 17, 2023): That was why it was an example. I didn't mean to suggest you use try instead of your instance. 😅 Glad you got it working! 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10114