mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:12:26 +08:00
api docs example (#11997)
* DEV: Escape backslashes in curl example We need to escape these backslashes otherwise they get filtered out when generating the api docs. * FIX: uniqItems should be uniqueItems
This commit is contained in:
parent
9ce7ec24e2
commit
8a001c2fe3
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqItems": true,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqItems": true,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -50,20 +50,20 @@ def api_docs_description
|
|||
as an HTTP header like this:
|
||||
|
||||
```
|
||||
curl -X GET "http://127.0.0.1:3000/admin/users/list/active.json" \
|
||||
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
|
||||
curl -X GET "http://127.0.0.1:3000/admin/users/list/active.json" \\
|
||||
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \\
|
||||
-H "Api-Username: system"
|
||||
```
|
||||
|
||||
and this is how POST requests will look:
|
||||
|
||||
```
|
||||
curl -X POST "http://127.0.0.1:3000/categories" \
|
||||
-H "Content-Type: multipart/form-data;" \
|
||||
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
|
||||
-H "Api-Username: system" \
|
||||
-F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \
|
||||
-F "color=49d9e9" \
|
||||
curl -X POST "http://127.0.0.1:3000/categories" \\
|
||||
-H "Content-Type: multipart/form-data;" \\
|
||||
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \\
|
||||
-H "Api-Username: system" \\
|
||||
-F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \\
|
||||
-F "color=49d9e9" \\
|
||||
-F "text_color=f0fcfd"
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user