docs: add a bunch of examples to /api/users/private/list

This commit is contained in:
b1ek 2024-08-30 17:32:46 +10:00
parent 0bfdfc9b4e
commit 0595a73b67
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 66 additions and 0 deletions

View File

@ -159,6 +159,67 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Filters' $ref: '#/components/schemas/Filters'
examples:
'Full':
description: |
This demonstrates all possible values of `filters`.
Note that `filters.type` is an enum: `[ "like", "is", "not" ]`, and so is `orders.sort`: `[ "asc", "desc" ]`
value: {
"filters": [
{
"column": "name",
"type": "like",
"filter": "%ad%"
},
{
"column": "name",
"type": "is",
"filter": "jade"
},
{
"column": "name",
"type": "not",
"filter": "jake"
}
],
"orders": [
{
"by": "id",
"sort": "asc"
},
{
"by": "id",
"sort": "desc"
}
],
"pagination": {
"size": 100,
"page": 1
}
}
'Empty':
description: |-
Its important that all keys are passed with empty values. You can't omit a key in this one
value: {
"filters": [],
"orders": [],
"pagination": null
}
'List deleted users':
description: |-
This is the recommended way to list deleted users
value: {
"filters": [
{
"column": "deleted_at",
"type": "not",
"filter": null
}
],
"orders": [],
"pagination": null
}
responses: responses:
200: 200:
description: OK description: OK
@ -465,6 +526,11 @@ components:
"column": "name", "column": "name",
"type": "is", "type": "is",
"filter": "jade" "filter": "jade"
},
{
"column": "name",
"type": "not",
"filter": "jake"
} }
] ]
orders: orders: