Skip to content

Commit

Permalink
fix: add pagination-ref format
Browse files Browse the repository at this point in the history
This change add pagination-ref format to the pagination metadata. This allows to
align the response with the platform guidelines; this update PaginationLinks
schema.

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Sep 13, 2023
1 parent f771613 commit 5575b6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions public.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1334,22 +1334,26 @@
"first": {
"description": "Reference to the first page of the request.",
"type": "string",
"format": "url"
"format": "pagination-ref",
"pattern": "^(\\/\\w+){4}\\?(offset|limit)=(0|[1-9]\\d*)\\&(offset|limit)=(0|[1-9]\\d*)$"
},
"last": {
"description": "Reference to the last page of the request.",
"type": "string",
"format": "url"
"format": "pagination-ref",
"pattern": "^(\\/\\w+){4}\\?(offset|limit)=(0|[1-9]\\d*)\\&(offset|limit)=(0|[1-9]\\d*)$"
},
"next": {
"description": "Reference to the next page of the request.",
"type": "string",
"format": "url"
"format": "pagination-ref",
"pattern": "^(\\/\\w+){4}\\?(offset|limit)=(0|[1-9]\\d*)\\&(offset|limit)=(0|[1-9]\\d*)$"
},
"previous": {
"description": "Reference to the previous page of the request.",
"type": "string",
"format": "url"
"format": "pagination-ref",
"pattern": "^(\\/\\w+){4}\\?(offset|limit)=(0|[1-9]\\d*)\\&(offset|limit)=(0|[1-9]\\d*)$"
}
},
"example": {
Expand Down
12 changes: 8 additions & 4 deletions public.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,23 @@ components:
first:
description: Reference to the first page of the request.
type: string
format: url
format: pagination-ref
pattern: ^(\/\w+){4}\?(offset|limit)=(0|[1-9]\d*)\&(offset|limit)=(0|[1-9]\d*)$
last:
description: Reference to the last page of the request.
type: string
format: url
format: pagination-ref
pattern: ^(\/\w+){4}\?(offset|limit)=(0|[1-9]\d*)\&(offset|limit)=(0|[1-9]\d*)$
next:
description: Reference to the next page of the request.
type: string
format: url
format: pagination-ref
pattern: ^(\/\w+){4}\?(offset|limit)=(0|[1-9]\d*)\&(offset|limit)=(0|[1-9]\d*)$
previous:
description: Reference to the previous page of the request.
type: string
format: url
format: pagination-ref
pattern: ^(\/\w+){4}\?(offset|limit)=(0|[1-9]\d*)\&(offset|limit)=(0|[1-9]\d*)$
example:
first: /api/idm/v1/domains?limit=10&offset=0
last: /api/idm/v1/domains?limit=10&offset=10
Expand Down

0 comments on commit 5575b6c

Please sign in to comment.