From 98e0a97c476e017d1b964213b98ea40be4db973b Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Fri, 12 May 2023 18:16:06 +0530 Subject: [PATCH] SWAGGER: Adds query example and response body example to /Availability (#264) This PR adds query examples and response body example to /Availability --------- Co-authored-by: Alex van Andel --- pages/api/availability/_get.ts | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pages/api/availability/_get.ts b/pages/api/availability/_get.ts index 2f8add247f..42371e0be7 100644 --- a/pages/api/availability/_get.ts +++ b/pages/api/availability/_get.ts @@ -18,38 +18,45 @@ import { stringOrNumber } from "@calcom/prisma/zod-utils"; * required: true * schema: * type: string + * example: "1234abcd5678efgh" * description: Your API key * - in: query * name: userId * schema: * type: integer + * example: 101 * description: ID of the user to fetch the availability for * - in: query * name: teamId * schema: * type: integer + * example: 123 * description: ID of the team to fetch the availability for * - in: query * name: username * schema: * type: string + * example: "alice" * description: username of the user to fetch the availability for * - in: query * name: dateFrom * schema: * type: string * format: date + * example: "2023-05-14 00:00:00" * description: Start Date of the availability query * - in: query * name: dateTo * schema: * type: string * format: date + * example: "2023-05-20 00:00:00" * description: End Date of the availability query * - in: query * name: eventTypeId * schema: * type: integer + * example: 123 * description: Event Type ID of the event type to fetch the availability for * operationId: availability * tags: @@ -57,6 +64,34 @@ import { stringOrNumber } from "@calcom/prisma/zod-utils"; * responses: * 200: * description: OK + * content: + * application/json: + * schema: + * type: object + * example: + * busy: + * - start: "2023-05-14T10:00:00.000Z" + * end: "2023-05-14T11:00:00.000Z" + * title: "Team meeting between Alice and Bob" + * - start: "2023-05-15T14:00:00.000Z" + * end: "2023-05-15T15:00:00.000Z" + * title: "Project review between Carol and Dave" + * - start: "2023-05-16T09:00:00.000Z" + * end: "2023-05-16T10:00:00.000Z" + * - start: "2023-05-17T13:00:00.000Z" + * end: "2023-05-17T14:00:00.000Z" + * timeZone: "America/New_York" + * workingHours: + * - days: [1, 2, 3, 4, 5] + * startTime: 540 + * endTime: 1020 + * userId: 101 + * dateOverrides: + * - date: "2023-05-15" + * startTime: 600 + * endTime: 960 + * userId: 101 + * currentSeats: 4 * 401: * description: Authorization information is missing or invalid. * 404: