diff --git a/public/openapi.yml b/public/openapi.yml index c9d9f81..06eea05 100644 --- a/public/openapi.yml +++ b/public/openapi.yml @@ -159,6 +159,67 @@ paths: application/json: schema: $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: 200: description: OK @@ -465,6 +526,11 @@ components: "column": "name", "type": "is", "filter": "jade" + }, + { + "column": "name", + "type": "not", + "filter": "jake" } ] orders: