Use an enum instead of a boolean to differentiate search

It's not very likely to have more modes of search besides normal and
trashed, but got surprised in that way quite often and it's nicer this
way anyways.
This commit is contained in:
eikek
2021-08-14 15:08:29 +02:00
parent a7b74bd5ae
commit edb344314f
7 changed files with 85 additions and 23 deletions

View File

@ -1478,7 +1478,7 @@ paths:
- $ref: "#/components/parameters/limit"
- $ref: "#/components/parameters/offset"
- $ref: "#/components/parameters/withDetails"
- $ref: "#/components/parameters/deleted"
- $ref: "#/components/parameters/searchMode"
responses:
200:
description: Ok
@ -4114,12 +4114,16 @@ components:
withDetails:
type: boolean
default: false
deleted:
type: boolean
default: false
searchMode:
type: string
format: searchmode
enum:
- normal
- trashed
default: normal
description: |
If this is true, the search performed only for
soft-deleted items.
Specify whether the search query should apply to
soft-deleted items or not.
query:
type: string
description: |
@ -5846,12 +5850,13 @@ components:
description: Whether to return details to each item.
schema:
type: boolean
deleted:
name: deleted
searchMode:
name: searchMode
in: query
description: Whether to search in soft-deleted items only.
schema:
type: boolean
type: string
format: searchmode
name:
name: name
in: path