mirror of
https://github.com/adidas/api-guidelines.git
synced 2025-10-25 15:19:19 +00:00
Updates execution/search-requests.md
Auto commit by GitBook Editor
This commit is contained in:
@@ -38,9 +38,9 @@
|
|||||||
* [Pagination](execution/pagination.md)
|
* [Pagination](execution/pagination.md)
|
||||||
* [Asynchronous Tasks](execution/asynchronous-tasks.md)
|
* [Asynchronous Tasks](execution/asynchronous-tasks.md)
|
||||||
* [Batch Operations](execution/batch-operations.md)
|
* [Batch Operations](execution/batch-operations.md)
|
||||||
* [Choosing Fields and Embedded Resources](execution/choosing-fields-and-embedded-resoruces.md)
|
|
||||||
* [Search Requests](execution/search-requests.md)
|
* [Search Requests](execution/search-requests.md)
|
||||||
* [Query Requests with Large Inputs](execution/query-requests-with-large-inputs.md)
|
* [Query Requests with Large Inputs](execution/query-requests-with-large-inputs.md)
|
||||||
|
* [Choosing Fields and Embedded Resources](execution/choosing-fields-and-embedded-resoruces.md)
|
||||||
* [Localization](execution/localization.md)
|
* [Localization](execution/localization.md)
|
||||||
* [Authentication](execution/authentication.md)
|
* [Authentication](execution/authentication.md)
|
||||||
* [Security](execution/security.md)
|
* [Security](execution/security.md)
|
||||||
|
|||||||
@@ -1,2 +1,48 @@
|
|||||||
# Search Requests
|
# Search Requests
|
||||||
When an action
|
A search (filter) operation on a collection resource **SHOULD** be defined as safe, idempotent and cacheable, therefore using the [GET HTTP request method](https://adidas-group.gitbooks.io/api-guidelines/content/protocol/use-appropriate-methods.html).
|
||||||
|
|
||||||
|
Every search parameter **SHOULD** be provided in the form of a query parameter. In the case some of search parameters being mutually exclusive or require the presence of another parameter the explanation **MUST** be part of operation's description.
|
||||||
|
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
A collection of orders can be filtered by either article id it includes or by article manufacturer id. The two parameters are mutually exclusive and cannot be used together. The API description for such a design should look as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
paths:
|
||||||
|
/orders:
|
||||||
|
x-summary: Collection of Orders
|
||||||
|
|
||||||
|
get:
|
||||||
|
summary: Retrieve or Search in the Collection of Orders
|
||||||
|
description: |
|
||||||
|
|
||||||
|
This operation allows to retrieve a filtered list of orders based on mutliple criteria:
|
||||||
|
|
||||||
|
1. **Filter Orders by Article Id**
|
||||||
|
2. **Filter Orders by Manufacturer Id**
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- name: article_id
|
||||||
|
in: query
|
||||||
|
description: |
|
||||||
|
Article Id. Denotes the id of an article that must be in the order.
|
||||||
|
|
||||||
|
**Mutually exclusive** with `manufacturer_id`.
|
||||||
|
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
x-example: article_id_1
|
||||||
|
|
||||||
|
- name: manufacturer_id
|
||||||
|
in: query
|
||||||
|
description: |
|
||||||
|
Manufacturer Id. Denotes an id of an manufacturer of an article that must be in the order.
|
||||||
|
|
||||||
|
**Mutually exclusive** with `article_id`.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
x-example: manufacturer_id_1
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user