mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 22:23:50 +03:00
[Docs] fix typos and reference to structs package (#13856)
This commit is contained in:
parent
d8c2c6cd59
commit
1a768e547c
1 changed files with 5 additions and 5 deletions
|
@ -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:
|
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
|
- **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/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.
|
- **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.
|
- **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
|
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)).
|
([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))
|
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91))
|
||||||
and referenced in
|
and referenced in
|
||||||
[routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go).
|
[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:
|
They can then be used like the following:
|
||||||
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318)).
|
([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))
|
([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))
|
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16))
|
||||||
They can be used like the following:
|
They can be used like the following:
|
||||||
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279))
|
([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)**
|
* **GET** endpoints return requested object and status **OK (200)**
|
||||||
* **DELETE** endpoints return status **No Content (204)**
|
* **DELETE** endpoints return status **No Content (204)**
|
||||||
* **POST** endpoints return status **Created (201)**, used to **create** new objects (e.g. a User)
|
* **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
|
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue