From 5575b6ca189e8d1c59984480ae03bf554e6fc0f8 Mon Sep 17 00:00:00 2001 From: Alejandro Visiedo Date: Tue, 12 Sep 2023 20:22:54 +0200 Subject: [PATCH] fix: add pagination-ref format 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 --- public.openapi.json | 12 ++++++++---- public.openapi.yaml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/public.openapi.json b/public.openapi.json index 12e1164..38b65d8 100644 --- a/public.openapi.json +++ b/public.openapi.json @@ -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": { diff --git a/public.openapi.yaml b/public.openapi.yaml index da4c8d5..00a5324 100644 --- a/public.openapi.yaml +++ b/public.openapi.yaml @@ -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