API documentation for endpoint #67

Closed
opened 2025-11-02 03:07:16 -06:00 by GiteaMirror · 33 comments
Owner

Originally created by @joubertredrat on GitHub (Nov 18, 2016).

Hi guys,

I think that a important thing on Gitea is have a API endpoint documentation on application or on site documentation like Swagger or Apidoc.
With this will be more easy to see all methods (or operations) and all information about each one of them.

Today on Gogs, this documentation is on github wiki and isn't easy to learn and work with this.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Originally created by @joubertredrat on GitHub (Nov 18, 2016). Hi guys, I think that a important thing on Gitea is have a API endpoint documentation on application or on site documentation like [Swagger](http://petstore.swagger.io/) or [Apidoc](http://apidocjs.com/example/). With this will be more easy to see all methods (or operations) and all information about each one of them. Today on Gogs, this documentation is on github wiki and isn't easy to learn and work with this. <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39507348-api-documentation-for-endpoint?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/docs label 2025-11-02 03:07:16 -06:00
Author
Owner

@tboerger commented on GitHub (Nov 24, 2016):

I also dislike the Wiki approach, the docs have to be bundled with the code and also exported automatically to the docs website.

@tboerger commented on GitHub (Nov 24, 2016): I also dislike the Wiki approach, the docs have to be bundled with the code and also exported automatically to the docs website.
Author
Owner

@bkcsoft commented on GitHub (Dec 26, 2016):

I started to play around with swagger[1] today, IMO it would be the best solution (even though I personally prefer ApiDoc...). I'm just not entirely sure how/where we should present it, @tboerger had the idea of integrating the docs in Gitea itself (e.g. try.gitea.io/docs/api ) though I'm not sure that is a good idea

[1] https://github.com/yvasiyarov/swagger

@bkcsoft commented on GitHub (Dec 26, 2016): I started to play around with swagger[1] today, IMO it would be the best solution (even though I personally prefer ApiDoc...). I'm just not entirely sure how/where we should present it, @tboerger had the idea of integrating the docs in Gitea itself (e.g. `try.gitea.io/docs/api` ) though I'm not sure that is a good idea [1] https://github.com/yvasiyarov/swagger
Author
Owner

@tboerger commented on GitHub (Dec 26, 2016):

We can enable or disable that via config flag. Additionally to that we can extract this documentation from every branch and provide all of this within our docs or at a separate page.

@tboerger commented on GitHub (Dec 26, 2016): We can enable or disable that via config flag. Additionally to that we can extract this documentation from every branch and provide all of this within our docs or at a separate page.
Author
Owner

@joubertredrat commented on GitHub (Dec 26, 2016):

For first I think that is good idea to documentation manually on https://api.gitea.io/ as example because today doesn't exists anything about API documentation

After this we can view automated tools like Swagger

@joubertredrat commented on GitHub (Dec 26, 2016): For first I think that is good idea to documentation manually on https://api.gitea.io/ as example because today doesn't exists anything about API documentation After this we can view automated tools like Swagger
Author
Owner

@tboerger commented on GitHub (Dec 26, 2016):

Nobody wants to do it twice, so we should directly provide something generated out of swagger annotations

@tboerger commented on GitHub (Dec 26, 2016): Nobody wants to do it twice, so we should directly provide something generated out of swagger annotations
Author
Owner

@lunny commented on GitHub (Dec 27, 2016):

Yes, we need an API document ASAP.

@lunny commented on GitHub (Dec 27, 2016): Yes, we need an API document ASAP.
Author
Owner

@sapk commented on GitHub (Mar 28, 2017):

We could use : https://goswagger.io/generate/spec.html ?

@sapk commented on GitHub (Mar 28, 2017): We could use : https://goswagger.io/generate/spec.html ?
Author
Owner

@ralphtheninja commented on GitHub (Apr 24, 2017):

Until there is a proper API documentation available. Where can I dig around to find out how to call the api?

@ralphtheninja commented on GitHub (Apr 24, 2017): Until there is a proper API documentation available. Where can I dig around to find out how to call the api?
Author
Owner

@sapk commented on GitHub (Apr 24, 2017):

You could find all api url in code here : https://github.com/go-gitea/gitea/blob/master/routers/api/v1/api.go#L230

You could copy-paste : https://github.com/sapk-fork/gitea/blob/generate-swagger/public/swagger.v1.json in http://editor.swagger.io for viewing incoming documentation.

You could also look at https://github.com/go-gitea/go-sdk that is a go package to access the api (all url are not implemented)

@sapk commented on GitHub (Apr 24, 2017): You could find all api url in code here : https://github.com/go-gitea/gitea/blob/master/routers/api/v1/api.go#L230 You could copy-paste : https://github.com/sapk-fork/gitea/blob/generate-swagger/public/swagger.v1.json in http://editor.swagger.io for viewing incoming documentation. You could also look at https://github.com/go-gitea/go-sdk that is a go package to access the api (all url are not implemented)
Author
Owner

@SeanFarrow commented on GitHub (Jul 18, 2017):

Hi,
Is there a swagger document available as of now? I need to generate a client in c#.

@SeanFarrow commented on GitHub (Jul 18, 2017): Hi, Is there a swagger document available as of now? I need to generate a client in c#.
Author
Owner

@lafriks commented on GitHub (Jul 18, 2017):

@SeanFarrow it is still WIP - https://try.gitea.io/swagger

@lafriks commented on GitHub (Jul 18, 2017): @SeanFarrow it is still WIP - https://try.gitea.io/swagger
Author
Owner

@SeanFarrow commented on GitHub (Jul 18, 2017):

Hi,

Thanks, is there a test gitea server anywaere?

From: Lauris BH [mailto:notifications@github.com]
Sent: Tuesday, July 18, 2017 20:28
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

@SeanFarrowhttps://github.com/seanfarrow it is still WIP - https://try.gitea.io/swagger


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-316171521, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fqOf-5_8u9n6dXk95j61V3MqdiGQks5sPQdJgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Jul 18, 2017): Hi, Thanks, is there a test gitea server anywaere? From: Lauris BH [mailto:notifications@github.com] Sent: Tuesday, July 18, 2017 20:28 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) @SeanFarrow<https://github.com/seanfarrow> it is still WIP - https://try.gitea.io/swagger — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-316171521>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fqOf-5_8u9n6dXk95j61V3MqdiGQks5sPQdJgaJpZM4K2yRe>.
Author
Owner

@SeanFarrow commented on GitHub (Jul 19, 2017):

Thanks, Do you know whether there are any test servers available, or alternatively a vagrant/packer base box. I'm tryingot write integration tests against the API.

@SeanFarrow commented on GitHub (Jul 19, 2017): Thanks, Do you know whether there are any test servers available, or alternatively a vagrant/packer base box. I'm tryingot write integration tests against the API.
Author
Owner

@lafriks commented on GitHub (Jul 19, 2017):

There is https://try.gitea.io but integration tests for api are run localy from development environment (see https://github.com/go-gitea/gitea/tree/master/integrations)

@lafriks commented on GitHub (Jul 19, 2017): There is https://try.gitea.io but integration tests for api are run localy from development environment (see https://github.com/go-gitea/gitea/tree/master/integrations)
Author
Owner

@SeanFarrow commented on GitHub (Jul 19, 2017):

How are the integration environments spun up?

From: Lauris BH [mailto:notifications@github.com]
Sent: Wednesday, July 19, 2017 11:34
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

There is https://try.gitea.io but integration tests for api are run localy from development environment (see https://github.com/go-gitea/gitea/tree/master/integrations)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-316343901, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fiXOvYvCT72JttXyaB_fUltjwC_Lks5sPduGgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Jul 19, 2017): How are the integration environments spun up? From: Lauris BH [mailto:notifications@github.com] Sent: Wednesday, July 19, 2017 11:34 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) There is https://try.gitea.io but integration tests for api are run localy from development environment (see https://github.com/go-gitea/gitea/tree/master/integrations) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-316343901>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fiXOvYvCT72JttXyaB_fUltjwC_Lks5sPduGgaJpZM4K2yRe>.
Author
Owner

@lafriks commented on GitHub (Jul 19, 2017):

On linux you need to run make test-pgsql or make test-mysql but you need postgresql or mysql set up correctly

@lafriks commented on GitHub (Jul 19, 2017): On linux you need to run `make test-pgsql` or `make test-mysql` but you need postgresql or mysql set up correctly
Author
Owner

@SeanFarrow commented on GitHub (Jul 19, 2017):

Ok, it would be nice if there were boxes so that this could be run from a windows box for testing—maybe a separate issue!

From: Lauris BH [mailto:notifications@github.com]
Sent: Wednesday, July 19, 2017 12:50
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

On linux you need to run make test-pgsql or make test-mysql but you need postgresql or mysql set up correctly


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-316360870, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fsDY0goiyI8EsdxE556llg_MDK5gks5sPe1QgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Jul 19, 2017): Ok, it would be nice if there were boxes so that this could be run from a windows box for testing—maybe a separate issue! From: Lauris BH [mailto:notifications@github.com] Sent: Wednesday, July 19, 2017 12:50 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) On linux you need to run make test-pgsql or make test-mysql but you need postgresql or mysql set up correctly — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-316360870>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fsDY0goiyI8EsdxE556llg_MDK5gks5sPe1QgaJpZM4K2yRe>.
Author
Owner

@SeanFarrow commented on GitHub (Jul 25, 2017):

Hi,

Assuming I have a url for a server, what is the uri for the api?
I've had a look at api.go and only see gitea.io url's.
Help appreciated.
Kind regards
Sean.

@SeanFarrow commented on GitHub (Jul 25, 2017): Hi, Assuming I have a url for a server, what is the uri for the api? I've had a look at api.go and only see gitea.io url's. Help appreciated. Kind regards Sean.
Author
Owner

@sapk commented on GitHub (Jul 25, 2017):

You could try to go to /swagger on your instance to view documentation and you could use integration test has an example for url, like : f1adaef458/integrations/api_issue_test.go (L25)

@sapk commented on GitHub (Jul 25, 2017): You could try to go to `/swagger` on your instance to view documentation and you could use integration test has an example for url, like : https://github.com/go-gitea/gitea/blob/f1adaef45849fc260b07be39a39b9c1ee5146923/integrations/api_issue_test.go#L25
Author
Owner

@SeanFarrow commented on GitHub (Jul 25, 2017):

Strange, the swagger url doesn’t seem present on that server.
Cheers
Sean.
Kino r

From: Antoine GIRARD [mailto:notifications@github.com]
Sent: Tuesday, July 25, 2017 14:11
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

You could try to go to /swagger on your instance to view documentation and you could use integration test has an example like for url f1adaef458/integrations/api_issue_test.go (L25)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-317732366, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Jul 25, 2017): Strange, the swagger url doesn’t seem present on that server. Cheers Sean. Kino r From: Antoine GIRARD [mailto:notifications@github.com] Sent: Tuesday, July 25, 2017 14:11 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) You could try to go to /swagger on your instance to view documentation and you could use integration test has an example like for url https://github.com/go-gitea/gitea/blob/f1adaef45849fc260b07be39a39b9c1ee5146923/integrations/api_issue_test.go#L25 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-317732366>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe>.
Author
Owner

@SeanFarrow commented on GitHub (Jul 27, 2017):

Hi,

I’m trying to go to url:
http://server:port/api/v1/orgs/MeasurementSystems
it can’t seem to find the page, as I keep getting an http404, what would be the correct uri to look an organizations repos?
This is for gitea v1.1.0.
Kind regards
Sean.
From: Antoine GIRARD [mailto:notifications@github.com]
Sent: Tuesday, July 25, 2017 14:11
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

You could try to go to /swagger on your instance to view documentation and you could use integration test has an example like for url f1adaef458/integrations/api_issue_test.go (L25)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-317732366, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Jul 27, 2017): Hi, I’m trying to go to url: http://server:port/api/v1/orgs/MeasurementSystems it can’t seem to find the page, as I keep getting an http404, what would be the correct uri to look an organizations repos? This is for gitea v1.1.0. Kind regards Sean. From: Antoine GIRARD [mailto:notifications@github.com] Sent: Tuesday, July 25, 2017 14:11 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) You could try to go to /swagger on your instance to view documentation and you could use integration test has an example like for url https://github.com/go-gitea/gitea/blob/f1adaef45849fc260b07be39a39b9c1ee5146923/integrations/api_issue_test.go#L25 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-317732366>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe>.
Author
Owner

@SeanFarrow commented on GitHub (Aug 1, 2017):

Hi all,

What is the minimum version of Gitea that the api works with, with v1.1.0, the API doesn't seem to exist, I'm only getting 404's and no swagger document exists at /swagger as noted above.
Any help appreciated.
Cheers
Sean.

@SeanFarrow commented on GitHub (Aug 1, 2017): Hi all, What is the minimum version of Gitea that the api works with, with v1.1.0, the API doesn't seem to exist, I'm only getting 404's and no swagger document exists at /swagger as noted above. Any help appreciated. Cheers Sean.
Author
Owner

@lunny commented on GitHub (Aug 1, 2017):

@SeanFarrow /swagger is the document which is on v1.2. But the APIs works well on v1.1.0

@lunny commented on GitHub (Aug 1, 2017): @SeanFarrow /swagger is the document which is on v1.2. But the APIs works well on v1.1.0
Author
Owner

@SeanFarrow commented on GitHub (Aug 1, 2017):

Ok, can you give me a sample uri please, I can’t seem to get this to work what ever uri I use!
Do I need to enable the api?

From: Lunny Xiao [mailto:notifications@github.com]
Sent: Tuesday, August 01, 2017 04:35
To: go-gitea/gitea gitea@noreply.github.com
Cc: Sean Farrow sean.farrow@seanfarrow.co.uk; Mention mention@noreply.github.com
Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194)

@SeanFarrowhttps://github.com/seanfarrow /swagger is the document which is on v1.2. But the APIs works well on v1.1.0


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/go-gitea/gitea/issues/194#issuecomment-319258451, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABY1ftoK39PjkTzk_mzT3dCCxJEghLK6ks5sTpzYgaJpZM4K2yRe.

@SeanFarrow commented on GitHub (Aug 1, 2017): Ok, can you give me a sample uri please, I can’t seem to get this to work what ever uri I use! Do I need to enable the api? From: Lunny Xiao [mailto:notifications@github.com] Sent: Tuesday, August 01, 2017 04:35 To: go-gitea/gitea <gitea@noreply.github.com> Cc: Sean Farrow <sean.farrow@seanfarrow.co.uk>; Mention <mention@noreply.github.com> Subject: Re: [go-gitea/gitea] API documentation for endpoint (#194) @SeanFarrow<https://github.com/seanfarrow> /swagger is the document which is on v1.2. But the APIs works well on v1.1.0 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/go-gitea/gitea/issues/194#issuecomment-319258451>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1ftoK39PjkTzk_mzT3dCCxJEghLK6ks5sTpzYgaJpZM4K2yRe>.
Author
Owner

@cez81 commented on GitHub (Sep 11, 2017):

@SeanFarrow If you haven't got this to work yet, here's an example https://try.gitea.io/api/v1/repos/search?q=gitea

@cez81 commented on GitHub (Sep 11, 2017): @SeanFarrow If you haven't got this to work yet, here's an example https://try.gitea.io/api/v1/repos/search?q=gitea
Author
Owner

@sapk commented on GitHub (Dec 15, 2017):

This one could be close

@sapk commented on GitHub (Dec 15, 2017): This one could be close
Author
Owner

@lunny commented on GitHub (Dec 15, 2017):

@sapk I think yes.

@lunny commented on GitHub (Dec 15, 2017): @sapk I think yes.
Author
Owner

@marbetschar commented on GitHub (Mar 14, 2018):

@sapk https://try.gitea.io/ seems to be down

@marbetschar commented on GitHub (Mar 14, 2018): @sapk https://try.gitea.io/ seems to be down
Author
Owner

@lunny commented on GitHub (Mar 14, 2018):

@marbetschar yes, we are changing to a new plan for bigger disk space.

@lunny commented on GitHub (Mar 14, 2018): @marbetschar yes, we are changing to a new plan for bigger disk space.
Author
Owner

@marbetschar commented on GitHub (Mar 15, 2018):

@lunny meanwhile, is there any documentation for the api available? We are working on a Gitea integration, but its not so easy getting things right by solely read the code in the repo.

@marbetschar commented on GitHub (Mar 15, 2018): @lunny meanwhile, is there any documentation for the api available? We are working on a Gitea integration, but its not so easy getting things right by solely read the code in the repo.
Author
Owner

@sapk commented on GitHub (Mar 15, 2018):

@marbetschar I just uploaded at https://app.swaggerhub.com/apis/gitea/gitea-api/1.1.1 you can see it there for the moment. I will need to auto-update that if we keep it.

You can always copy https://raw.githubusercontent.com/go-gitea/gitea/master/public/swagger.v1.json to https://editor.swagger.io/ (File -> Import URL)

@sapk commented on GitHub (Mar 15, 2018): @marbetschar I just uploaded at https://app.swaggerhub.com/apis/gitea/gitea-api/1.1.1 you can see it there for the moment. I will need to auto-update that if we keep it. You can always copy https://raw.githubusercontent.com/go-gitea/gitea/master/public/swagger.v1.json to https://editor.swagger.io/ (File -> Import URL)
Author
Owner

@marbetschar commented on GitHub (Mar 15, 2018):

@sapk thanks for this! I can see a bunch of errors there (screenshot attached), but I guess I can ignore them for now?

bildschirmfoto 2018-03-15 um 11 53 13
@marbetschar commented on GitHub (Mar 15, 2018): @sapk thanks for this! I can see a bunch of errors there (screenshot attached), but I guess I can ignore them for now? <img width="1280" alt="bildschirmfoto 2018-03-15 um 11 53 13" src="https://user-images.githubusercontent.com/392542/37459167-8f4c8932-2847-11e8-8fb3-37af0eb64047.png">
Author
Owner

@sapk commented on GitHub (Mar 15, 2018):

@marbetschar yes, we need to fill security schema and maybe other spec to be fully compliant with swagger and the editor seems to be more exigent than the swagger-ui we use in gitea. But with all the definitions allready done you should get enough information to get started with api. You can dismiss error and hide them even.

@sapk commented on GitHub (Mar 15, 2018): @marbetschar yes, we need to fill security schema and maybe other spec to be fully compliant with swagger and the editor seems to be more exigent than the swagger-ui we use in gitea. But with all the definitions allready done you should get enough information to get started with api. You can dismiss error and hide them even.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#67