-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
API documentation for endpoint #194
Comments
I also dislike the Wiki approach, the docs have to be bundled with the code and also exported automatically to the docs website. |
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. |
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. |
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 |
Nobody wants to do it twice, so we should directly provide something generated out of swagger annotations |
Yes, we need an API document ASAP. |
We could use : https://goswagger.io/generate/spec.html ? |
Until there is a proper API documentation available. Where can I dig around to find out how to call the api? |
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) |
…#194) * Changes Door43 to DCS and adds images * Updates favicon.png to a 143x143 image
Hi, |
@SeanFarrow it is still WIP - https://try.gitea.io/swagger |
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fqOf-5_8u9n6dXk95j61V3MqdiGQks5sPQdJgaJpZM4K2yRe>.
|
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. |
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) |
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fiXOvYvCT72JttXyaB_fUltjwC_Lks5sPduGgaJpZM4K2yRe>.
|
On linux you need to run |
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fsDY0goiyI8EsdxE556llg_MDK5gks5sPe1QgaJpZM4K2yRe>.
|
Hi, Assuming I have a url for a server, what is the uri for the api? |
You could try to go to gitea/integrations/api_issue_test.go Line 25 in f1adaef
|
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe>.
|
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1fgfx_HKG-mikZXVdpBZXw3Q9lEr3ks5sRelwgaJpZM4K2yRe>.
|
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. |
@SeanFarrow /swagger is the document which is on v1.2. But the APIs works well on v1.1.0 |
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<#194 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABY1ftoK39PjkTzk_mzT3dCCxJEghLK6ks5sTpzYgaJpZM4K2yRe>.
|
@SeanFarrow If you haven't got this to work yet, here's an example https://try.gitea.io/api/v1/repos/search?q=gitea |
This one could be close |
@sapk I think yes. |
@sapk https://try.gitea.io/ seems to be down |
@marbetschar yes, we are changing to a new plan for bigger disk space. |
@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 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 thanks for this! I can see a bunch of errors there (screenshot attached), but I guess I can ignore them for now? |
@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. |
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.
The text was updated successfully, but these errors were encountered: