Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions openapi/components/parameters/Filter.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
name: filter
description: |-
Filters the collection items using space-separated `field:value` pairs.
See each list endpoint for the specific fields it supports.

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - exact match
- `field:value1,value2` - match any of the comma-separated values (OR)
- Time ranges: use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `status:placed` - filter by single status.
- `status:placed,completed` - filter by multiple statuses.
- `createdAt:30d` - filter orders created in the last 30 days.
- `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7` - filter by specific order ID.
- `status:placed createdAt:7d` - combine multiple filters.
- Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.
Comment thread
redocly[bot] marked this conversation as resolved.
in: query
required: false
schema:
type: string
type: string
Comment thread
rudi23 marked this conversation as resolved.
10 changes: 3 additions & 7 deletions openapi/components/parameters/Search.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: search
in: query
description: |-
Performs a case-insensitive text search across relevant fields in the collection.

**Fields searched depend on the endpoint:**
- **Menu items:** `name`, `photoTextDescription`
- **Orders:** `customerName`, `id`

Returns items where any of the searchable fields contain the search term as a substring.
Performs a case-insensitive text search across the endpoint's searchable fields,
returning items where any of those fields contain the search term as a substring.
See each list endpoint for the specific fields it searches.
required: false
schema:
type: string
Comment thread
redocly[bot] marked this conversation as resolved.
Comment thread
rudi23 marked this conversation as resolved.
31 changes: 31 additions & 0 deletions openapi/paths/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,39 @@ get:
- $ref: ../components/parameters/After.yaml
- $ref: ../components/parameters/Before.yaml
- $ref: ../components/parameters/Sort.yaml
description: |-
Sorts the collection by a single field. Prefix with `-` for descending order
(for example, `-price`); omit the prefix for ascending order (`price`).

**Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id`
example: '-price'
- $ref: ../components/parameters/Filter.yaml
description: |-
Filters the collection items using space-separated `field:value` pairs.

**Filterable fields:** `name`, `category`, `price`, `createdAt`, `id`

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - Exact match
- `field:value1,value2` - Match any of the comma-separated values (OR)
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `category:beverage` - Filter by a single category.
- `category:beverage,dessert` - Filter by multiple categories.
- `createdAt:7d` - Menu items created in the last 7 days.
- `name:Latte` - Filter by name.
- `category:beverage price:400` - Combine multiple filters.
example: category:beverage
Comment thread
rudi23 marked this conversation as resolved.
- $ref: ../components/parameters/Search.yaml
description: |-
Performs a case-insensitive text search across the searchable fields, returning
items where any of them contain the search term as a substring.

**Searchable fields:** `name`, `photoTextDescription`
Comment thread
redocly[bot] marked this conversation as resolved.
example: Latte
- $ref: ../components/parameters/Limit.yaml
responses:
'200':
Expand Down
6 changes: 6 additions & 0 deletions openapi/paths/order-items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ get:
parameters:
- $ref: ../components/parameters/Filter.yaml
required: true
description: |-
Selects the order whose items to return, using a single `orderId:<value>` pair
(for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`).

This filter is required and only the `orderId` field is supported.
example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7
Comment thread
rudi23 marked this conversation as resolved.
responses:
'200':
description: Successful operation.
Expand Down
31 changes: 31 additions & 0 deletions openapi/paths/orders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,42 @@ get:
- orders:read
parameters:
- $ref: ../components/parameters/Filter.yaml
description: |-
Filters the collection items using space-separated `field:value` pairs.

**Filterable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `id`

**Format:** `field1:value1 field2:value2`

**Supported operators:**
- `field:value` - Exact match
- `field:value1,value2` - Match any of the comma-separated values (OR)
- Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc.

**Examples:**
- `status:placed` - Filter by a single status.
- `status:placed,completed` - Filter by multiple statuses.
- `createdAt:30d` - Orders created in the last 30 days.
- `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order ID.
- `status:placed createdAt:7d` - Combine multiple filters.
example: status:placed
- $ref: ../components/parameters/Sort.yaml
description: |-
Sorts the collection by a single field. Prefix with `-` for descending order
(for example, `-createdAt`); omit the prefix for ascending order (`createdAt`).

**Sortable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `updatedAt`, `id`
example: '-createdAt'
Comment thread
rudi23 marked this conversation as resolved.
- $ref: ../components/parameters/Limit.yaml
- $ref: ../components/parameters/After.yaml
- $ref: ../components/parameters/Before.yaml
- $ref: ../components/parameters/Search.yaml
description: |-
Performs a case-insensitive text search across the searchable fields, returning
items where any of them contain the search term as a substring.

**Searchable fields:** `customerName`, `id`
Comment thread
rudi23 marked this conversation as resolved.
example: John
responses:
'200':
description: Successful operation.
Expand Down