From 1a768e547c076f21338b84e7cd74a3f967e9156c Mon Sep 17 00:00:00 2001 From: Nuno Silva Date: Sat, 5 Dec 2020 05:08:46 +0000 Subject: [PATCH] [Docs] fix typos and reference to structs package (#13856) --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b5ca5620..b15dc1d2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -158,7 +158,7 @@ import ( To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The gitea code is divided into the following parts: - **integration:** Integrations tests -- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependecies to other code in Gitea should be avoided although some modules might be needed (for example for logging). +- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging). - **models/fixtures:** Sample model data used in integration tests. - **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step. - **modules:** Different modules to handle specific functionality in Gitea. @@ -181,16 +181,16 @@ The same applies to status responses. If you notice a problem, feel free to leav All expected results (errors, success, fail messages) should be documented ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)). -All JSON input types must be defined as a struct in `models/structs/` +All JSON input types must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91)) and referenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go). They can then be used like the following: ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318)). -All JSON responses must be defined as a struct in `models/structs/` +All JSON responses must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68)) -and referenced in its category in `routers/api/v1/swagger/` +and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16)) They can be used like the following: ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279)) @@ -199,7 +199,7 @@ In general, HTTP methods are chosen as follows: * **GET** endpoints return requested object and status **OK (200)** * **DELETE** endpoints return status **No Content (204)** * **POST** endpoints return status **Created (201)**, used to **create** new objects (e.g. a User) - * **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Obejcts (e.g. User) to something (e.g. Org-Team) + * **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Objects (e.g. User) to something (e.g. Org-Team) * **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object