Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2018-11-02 04:28:37 +0300
committerEvan Read <eread@gitlab.com>2019-01-07 07:11:39 +0300
commit4671cb7836d9269bd965be946dd9d62fc7e1ddef (patch)
tree3cf342da7b6d7b3486a77546e4465534278b0590 /doc
parent2268ddc7de0709cac5d657688732d215164128ee (diff)
Add API topic template
Diffstat (limited to 'doc')
-rw-r--r--doc/development/documentation/styleguide.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/development/documentation/styleguide.md b/doc/development/documentation/styleguide.md
index e2c29ced517..a18c21d921a 100644
--- a/doc/development/documentation/styleguide.md
+++ b/doc/development/documentation/styleguide.md
@@ -588,6 +588,41 @@ on this document. Further explanation is given below.
- Every method must have a cURL example.
- Every method must have a response body (in JSON format).
+### API topic template
+
+The following can be used as a template to get started:
+
+```md
+## Descriptive title
+
+One or two sentence description of what endpoint does.
+
+```
+METHOD /endpoint
+```
+
+| Attribute | Type | Required | Description |
+|:------------|:---------|:---------|:----------------------|
+| `attribute` | datatype | yes/no | Detailed description. |
+| `attribute` | datatype | yes/no | Detailed description. |
+
+Example request:
+
+```sh
+curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" 'https://gitlab.example.com/api/v4/endpoint?parameters'
+```
+
+Example response:
+
+```json
+[
+ {
+ }
+]
+```
+
+```
+
### Fake tokens
There may be times where a token is needed to demonstrate an API call using