You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -177,6 +177,23 @@ To maintain understandable code and avoid circular dependencies it is important
177
177
-**templates:** Golang templates for generating the html output.
178
178
-**vendor:** External code that Gitea depends on.
179
179
180
+
## API v1
181
+
182
+
The API is documented by [swagger](http://gitea.com/api/swagger) and is based on [GitHub API v3](https://developer.github.com/v3/).
183
+
So if there exist a endpoint on GitHub API it should be the same for gitea. If GitHub dont provide a functionality Gitea does, a own endpoint can cover this. If a information is on Gitea but not on GitHub API a new field is used wich doesnt coldie with GitHub ones.
184
+
185
+
All expected results (errors, success, fail messages) should be documented ([example](https://github.com/go-gitea/gitea/blob/master/routers/api/v1/repo/issue.go#L319-L327)).
186
+
187
+
All JSON input types must be defined as struct in `models/structs/` ([example](https://github.com/go-gitea/gitea/blob/master/modules/structs/issue.go#L76-L91)) and reverenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/master/routers/api/v1/swagger/options.go), they can be used then as follow: ([example](https://github.com/go-gitea/gitea/blob/master/routers/api/v1/repo/issue.go#L318)).
188
+
189
+
All JSON responces must be defined as struct in `models/structs/` ([example](https://github.com/go-gitea/gitea/blob/master/modules/structs/issue.go#L36-L68)) and reverenced in its category in `routers/api/v1/swagger/` ([example](https://github.com/go-gitea/gitea/blob/master/routers/api/v1/swagger/issue.go#L11-L16)), they can be used the as follow: ([example](https://github.com/go-gitea/gitea/blob/master/routers/api/v1/repo/issue.go#L277-L279))
190
+
191
+
* GET endpoints return status `OK (200)`,
192
+
* POST endpoints return status `Created (201)` and
193
+
* DELETE endpoints return status `No Content (204)`
194
+
195
+
A endpoint wich change/edit a object expect all fields to be optional (expect ones to identify the object).
0 commit comments