From e4ecb49ff1b4b2111f76dbab2d4838250ad08653 Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Wed, 9 Apr 2025 17:36:39 +0000 Subject: [PATCH] Add pagination metadata to API responses. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/92df875c-f34c-46d8-979f-ae5d8771dfe6.jpg --- server/routes.ts | 57 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/server/routes.ts b/server/routes.ts index 6c96d48..1db8a0b 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -495,13 +495,18 @@ export async function registerRoutes(app: Express): Promise { * - $ref: '#/components/parameters/skipParam' * responses: * 200: - * description: A list of AD users + * description: A list of AD users with pagination metadata * content: * application/json: * schema: - * type: array - * items: - * $ref: '#/components/schemas/AdUser' + * type: object + * properties: + * data: + * type: array + * items: + * $ref: '#/components/schemas/AdUser' + * metadata: + * $ref: '#/components/responses/PaginatedResponse/content/application~1json/schema/properties/metadata' * 401: * $ref: '#/components/responses/UnauthorizedError' */ @@ -1024,9 +1029,14 @@ export async function registerRoutes(app: Express): Promise { * content: * application/json: * schema: - * type: array - * items: - * $ref: '#/components/schemas/AdGroup' + * type: object + * properties: + * data: + * type: array + * items: + * $ref: '#/components/schemas/AdGroup' + * metadata: + * $ref: '#/components/responses/PaginatedResponse/content/application~1json/schema/properties/metadata' * 401: * $ref: '#/components/responses/UnauthorizedError' * 404: @@ -1373,9 +1383,14 @@ export async function registerRoutes(app: Express): Promise { * content: * application/json: * schema: - * type: array - * items: - * $ref: '#/components/schemas/AdOrgUnit' + * type: object + * properties: + * data: + * type: array + * items: + * $ref: '#/components/schemas/AdOrgUnit' + * metadata: + * $ref: '#/components/responses/PaginatedResponse/content/application~1json/schema/properties/metadata' * 401: * $ref: '#/components/responses/UnauthorizedError' * 404: @@ -1586,9 +1601,14 @@ export async function registerRoutes(app: Express): Promise { * content: * application/json: * schema: - * type: array - * items: - * $ref: '#/components/schemas/AdComputer' + * type: object + * properties: + * data: + * type: array + * items: + * $ref: '#/components/schemas/AdComputer' + * metadata: + * $ref: '#/components/responses/PaginatedResponse/content/application~1json/schema/properties/metadata' * 401: * $ref: '#/components/responses/UnauthorizedError' * 404: @@ -1975,9 +1995,14 @@ export async function registerRoutes(app: Express): Promise { * content: * application/json: * schema: - * type: array - * items: - * $ref: '#/components/schemas/AdDomain' + * type: object + * properties: + * data: + * type: array + * items: + * $ref: '#/components/schemas/AdDomain' + * metadata: + * $ref: '#/components/responses/PaginatedResponse/content/application~1json/schema/properties/metadata' * 401: * $ref: '#/components/responses/UnauthorizedError' * 404: