From 4e24b6f7c050f623f12f66dd5cf15d7f83165cea Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Fri, 10 Mar 2023 22:34:14 +0530 Subject: [PATCH] Swagger/multiple fixes (#248) This PR adds - Swagger fixes for Teams endpoint - Removes unintended remnant from custom input - Swagger fixes for Payments endpoint --- pages/api/custom-inputs/_post.ts | 6 ------ pages/api/payments/[id].ts | 6 ++++++ pages/api/teams/[teamId]/_delete.ts | 6 ++++++ pages/api/teams/[teamId]/_get.ts | 6 ++++++ pages/api/teams/[teamId]/_patch.ts | 20 ++++++++++++++++++++ pages/api/teams/_get.ts | 7 +++++++ pages/api/teams/_post.ts | 24 ++++++++++++++++++++++++ 7 files changed, 69 insertions(+), 6 deletions(-) diff --git a/pages/api/custom-inputs/_post.ts b/pages/api/custom-inputs/_post.ts index 56d15816a4..331fdd732f 100644 --- a/pages/api/custom-inputs/_post.ts +++ b/pages/api/custom-inputs/_post.ts @@ -8,12 +8,6 @@ import { schemaEventTypeCustomInputPublic, } from "~/lib/validations/event-type-custom-input"; -// id: z.number().int(), -// eventTypeId: z.number().int(), -// label: z.string(), -// type: z.nativeEnum(EventTypeCustomInputType), -// required: z.boolean(), -// placeholder: z.string(), /** * @swagger * /custom-inputs: diff --git a/pages/api/payments/[id].ts b/pages/api/payments/[id].ts index 8e3657be6a..f8a54ff7f4 100644 --- a/pages/api/payments/[id].ts +++ b/pages/api/payments/[id].ts @@ -14,6 +14,12 @@ import { * get: * summary: Find a payment * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * - in: path * name: id * schema: diff --git a/pages/api/teams/[teamId]/_delete.ts b/pages/api/teams/[teamId]/_delete.ts index 77e3442705..e81be99974 100644 --- a/pages/api/teams/[teamId]/_delete.ts +++ b/pages/api/teams/[teamId]/_delete.ts @@ -19,6 +19,12 @@ import { checkPermissions } from "./_auth-middleware"; * type: integer * required: true * description: ID of the team to delete + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - teams * responses: diff --git a/pages/api/teams/[teamId]/_get.ts b/pages/api/teams/[teamId]/_get.ts index 2c22847418..cff0e987c9 100644 --- a/pages/api/teams/[teamId]/_get.ts +++ b/pages/api/teams/[teamId]/_get.ts @@ -19,6 +19,12 @@ import { schemaTeamReadPublic } from "~/lib/validations/team"; * type: integer * required: true * description: ID of the team to get + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - teams * responses: diff --git a/pages/api/teams/[teamId]/_patch.ts b/pages/api/teams/[teamId]/_patch.ts index ddf83e5883..93d1a3a46a 100644 --- a/pages/api/teams/[teamId]/_patch.ts +++ b/pages/api/teams/[teamId]/_patch.ts @@ -24,6 +24,26 @@ import { schemaTeamReadPublic, schemaTeamUpdateBodyParams } from "~/lib/validati * type: integer * required: true * description: ID of the team to edit + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key + * requestBody: + * description: Create a new custom input for an event type + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * description: Name of the team + * slug: + * type: string + * description: A unique slug that works as path for the team public page * tags: * - teams * responses: diff --git a/pages/api/teams/_get.ts b/pages/api/teams/_get.ts index ca038fdc18..49af07ac8e 100644 --- a/pages/api/teams/_get.ts +++ b/pages/api/teams/_get.ts @@ -11,6 +11,13 @@ import { schemaTeamsReadPublic } from "~/lib/validations/team"; * get: * operationId: listTeams * summary: Find all teams + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key * tags: * - teams * responses: diff --git a/pages/api/teams/_post.ts b/pages/api/teams/_post.ts index ef0783e4df..af032d00d4 100644 --- a/pages/api/teams/_post.ts +++ b/pages/api/teams/_post.ts @@ -14,6 +14,30 @@ import { schemaTeamBodyParams, schemaTeamReadPublic } from "~/lib/validations/te * post: * operationId: addTeam * summary: Creates a new team + * parameters: + * - in: query + * name: apiKey + * required: true + * schema: + * type: string + * description: Your API key + * requestBody: + * description: Create a new custom input for an event type + * required: true + * content: + * application/json: + * schema: + * type: object + * required: + * - name + * - slug + * properties: + * name: + * type: string + * description: Name of the team + * slug: + * type: string + * description: A unique slug that works as path for the team public page * tags: * - teams * responses: