Skip to content

Commit 023d557

Browse files
authored
feat(specs): add sort and order handling in query parameters (#1304)
1 parent 1548826 commit 023d557

File tree

13 files changed

+103
-1
lines changed

13 files changed

+103
-1
lines changed

specs/ingestion/common/authenticationParameters.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ platformWithNone:
3333
oneOf:
3434
- $ref: './schemas/authentication.yml#/Platform'
3535
- $ref: '#/platformNone'
36+
37+
sort:
38+
name: sort
39+
in: query
40+
description: The key by which the list should be sorted.
41+
required: false
42+
schema:
43+
$ref: '#/authenticationSortKeys'
44+
45+
authenticationSortKeys:
46+
type: string
47+
description: Used to sort the Authentication list endpoint.
48+
enum: [name, auth_type, platform, updatedAt, createdAt]

specs/ingestion/common/destinationParameters.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@ authenticationID:
2222
type: array
2323
items:
2424
$ref: './schemas/common.yml#/authenticationID'
25+
26+
sort:
27+
name: sort
28+
in: query
29+
description: The key by which the list should be sorted.
30+
required: false
31+
schema:
32+
$ref: '#/destinationSortKeys'
33+
34+
destinationSortKeys:
35+
type: string
36+
description: Used to sort the Destination list endpoint.
37+
enum: [name, type, updatedAt, createdAt]

specs/ingestion/common/observabilityParameters.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ taskID:
3131
description: Filter by taskID.
3232
schema:
3333
$ref: './schemas/common.yml#/taskID'
34+
35+
runSort:
36+
name: sort
37+
in: query
38+
description: The key by which the list should be sorted.
39+
required: false
40+
schema:
41+
$ref: '#/runSortKeys'
42+
43+
runSortKeys:
44+
type: string
45+
description: Used to sort the Run list endpoint.
46+
enum: [status, updatedAt, createdAt]
47+
48+
eventSort:
49+
name: sort
50+
in: query
51+
description: The key by which the list should be sorted.
52+
required: false
53+
schema:
54+
$ref: '#/eventSortKeys'
55+
56+
eventSortKeys:
57+
type: string
58+
description: Used to sort the Event list endpoint.
59+
enum: [status, type, publishedAt]

specs/ingestion/common/parameters.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,16 @@ page:
6161
required: false
6262
schema:
6363
type: integer
64+
65+
order:
66+
name: order
67+
in: query
68+
description: The order of the returned list.
69+
required: false
70+
schema:
71+
$ref: '#/orderKeys'
72+
73+
orderKeys:
74+
type: string
75+
description: Used to order a sorted request.
76+
enum: [asc, desc]

specs/ingestion/common/schemas/source.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ SourceUpdateCommercetools:
194194
items:
195195
type: string
196196

197-
198197
SourceUpdateInput:
199198
oneOf:
200199
- $ref: '#/SourceUpdateCommercetools'

specs/ingestion/common/sourceParameters.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,16 @@ authenticationID:
2525
items:
2626
$ref: './schemas/common.yml#/authenticationID'
2727
example: 10000000-0a75-4000-a000-000000000001,none
28+
29+
sort:
30+
name: sort
31+
in: query
32+
description: The key by which the list should be sorted.
33+
required: false
34+
schema:
35+
$ref: '#/sourceSortKeys'
36+
37+
sourceSortKeys:
38+
type: string
39+
description: Used to sort the Source list endpoint.
40+
enum: [name, type, updatedAt, createdAt]

specs/ingestion/common/taskParameters.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@ triggerType:
5656
items:
5757
$ref: './schemas/task.yml#/TriggerType'
5858
example: onDemand,schedule
59+
60+
sort:
61+
name: sort
62+
in: query
63+
description: The key by which the list should be sorted.
64+
required: false
65+
schema:
66+
$ref: '#/taskSortKeys'
67+
68+
taskSortKeys:
69+
type: string
70+
description: Used to sort the Task list endpoint.
71+
enum: [enabled, triggerType, action, updatedAt, createdAt]

specs/ingestion/paths/authentications/authentications.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ get:
99
- $ref: '../../common/parameters.yml#/page'
1010
- $ref: '../../common/authenticationParameters.yml#/type'
1111
- $ref: '../../common/authenticationParameters.yml#/platform'
12+
- $ref: '../../common/authenticationParameters.yml#/sort'
13+
- $ref: '../../common/parameters.yml#/order'
1214
responses:
1315
'200':
1416
description: OK

specs/ingestion/paths/destinations/destinations.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ get:
99
- $ref: '../../common/parameters.yml#/page'
1010
- $ref: '../../common/destinationParameters.yml#/type'
1111
- $ref: '../../common/destinationParameters.yml#/authenticationID'
12+
- $ref: '../../common/destinationParameters.yml#/sort'
13+
- $ref: '../../common/parameters.yml#/order'
1214
responses:
1315
'200':
1416
description: OK

specs/ingestion/paths/runs/events/events.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ get:
88
- $ref: '../../../common/parameters.yml#/pathRunID'
99
- $ref: '../../../common/observabilityParameters.yml#/eventStatus'
1010
- $ref: '../../../common/observabilityParameters.yml#/eventType'
11+
- $ref: '../../../common/observabilityParameters.yml#/eventSort'
12+
- $ref: '../../../common/parameters.yml#/order'
1113
responses:
1214
'200':
1315
description: OK

0 commit comments

Comments
 (0)