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:
Blake Erickson 2021-02-08 10:09:44 -07:00 committed by GitHub
parent 9ce7ec24e2
commit 8a001c2fe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{
"type": "array",
"minItems": 1,
"uniqItems": true,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {

View File

@ -1,7 +1,7 @@
{
"type": "array",
"minItems": 1,
"uniqItems": true,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {

View File

@ -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"
```