Skip to content

Commit

Permalink
Add documentation for filtering record via API calls params
Browse files Browse the repository at this point in the history
In almost all our GET / endpoints (index action), we have the
built-in capability of filtering records using Ransack appending
the `?q[attribute_eq]=value` string.

This change documents that possibility for all the enpoints where
this is available.
  • Loading branch information
kennyadsl committed Jul 6, 2021
1 parent b0a6184 commit 33fe5dc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions api/openapi/solidus-api.oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -117,6 +118,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
'/orders/{number}':
Expand Down Expand Up @@ -257,6 +259,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
'/countries/{id}':
get:
responses:
Expand Down Expand Up @@ -516,6 +519,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -837,6 +841,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -1203,6 +1208,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
'/users/{id}':
Expand Down Expand Up @@ -1398,6 +1404,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -1520,6 +1527,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -1682,6 +1690,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -1898,6 +1907,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -2053,6 +2063,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
- order-token: []
Expand Down Expand Up @@ -2213,6 +2224,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -2803,6 +2815,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -2964,6 +2977,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -3153,6 +3167,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -3303,6 +3318,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -3454,6 +3470,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -3671,6 +3688,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -3822,6 +3840,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -3985,6 +4004,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
/users:
Expand Down Expand Up @@ -4012,6 +4032,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -4071,6 +4092,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
post:
Expand Down Expand Up @@ -5666,8 +5688,10 @@ paths:
name: id
schema:
type: integer
description: The id of the Taxon
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
- in: query
name: simple
schema:
Expand Down Expand Up @@ -5702,6 +5726,7 @@ paths:
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/q'
security:
- api-key: []
parameters:
Expand Down Expand Up @@ -5794,6 +5819,12 @@ components:
schema:
type: integer
default: 25
q:
name: q
in: query
schema:
example: '?q[attribute_eq]=value'
description: 'Allows to query results based on search filters provided by Ransack (https://github.com/activerecord-hackery/ransack/).'
responses:
not-found:
description: ''
Expand Down

0 comments on commit 33fe5dc

Please sign in to comment.