fix: add missing OpenAPI ApiParam decorators to API v2 controllers (#28305)

* fix: add missing apiparam decorators

* chore: move api param to class level

* revert oasdiff

* chore

* fix: update oasdiff-err-ignore.txt

* chore
This commit is contained in:
Romit authored and GitHub committed 2026-03-10 14:34:21 +05:30
1 parent e75614164b
commit f3f5523f31
21 files changed
+689 -27

No files matched your search

@@ -14,7 +14,7 @@ import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
import { TeamsEventTypesService } from "@/modules/teams/event-types/services/teams-event-types.service";
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post, UseGuards } from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
import {
@@ -36,6 +36,7 @@ import { PrivateLinksService } from "../services/private-links.service";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsEventTypesPrivateLinksController {
constructor(
private readonly privateLinksService: PrivateLinksService,
@@ -40,6 +40,7 @@ import type { Webhook } from "@calcom/prisma/client";
@UseGuards(ApiAuthGuard, IsUserEventTypeWebhookGuard)
@DocsTags("Event Types / Webhooks")
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
@ApiParam({ name: "eventTypeId", type: Number, required: true })
export class EventTypeWebhooksController {
constructor(
private readonly webhooksService: WebhooksService,
@@ -36,6 +36,7 @@ import { OAuthClientGuard } from "../../guards/oauth-client-guard";
description: "OAuth client secret key",
required: true,
})
@ApiParam({ name: "clientId", type: String, required: true })
export class OAuthClientWebhooksController {
constructor(
private readonly webhooksService: WebhooksService,
@@ -61,6 +61,7 @@ export type OAuthCallbackState = {
version: API_VERSIONS_VALUES,
})
@DocsTags("Orgs / Teams / Conferencing")
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsConferencingController {
constructor(
private readonly conferencingService: ConferencingService,
@@ -184,12 +185,6 @@ export class OrganizationsConferencingController {
@Get("/teams/:teamId/conferencing/default")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Get team default conferencing application" })
@ApiParam({
name: "app",
description: "Conferencing application type",
enum: [GOOGLE_MEET, ZOOM, OFFICE_365_VIDEO, CAL_VIDEO],
required: true,
})
async getTeamDefaultApp(
@GetUser() user: UserWithProfile,
@Param("teamId", ParseIntPipe) teamId: number
@@ -41,7 +41,7 @@ import {
Query,
Logger,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
import { handleCreatePhoneCall } from "@calcom/platform-libraries";
@@ -66,6 +66,7 @@ export type EventTypeHandlerResponse = {
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsEventTypesController {
private readonly logger = new Logger("OrganizationsEventTypesController");
@@ -136,6 +137,7 @@ export class OrganizationsEventTypesController {
@Post("/teams/:teamId/event-types/:eventTypeId/create-phone-call")
@UseGuards(ApiAuthGuard, IsOrgGuard, IsTeamInOrg, RolesGuard)
@ApiOperation({ summary: "Create a phone call" })
@ApiParam({ name: "teamId", type: Number, required: true })
async createPhoneCall(
@Param("eventTypeId") eventTypeId: number,
@Param("orgId", ParseIntPipe) orgId: number,
@@ -14,7 +14,7 @@ import {
Query,
UseGuards,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { API_VERSIONS_VALUES } from "@/lib/api-versions";
import { X_CAL_CLIENT_ID_HEADER, X_CAL_SECRET_KEY_HEADER } from "@/lib/docs/headers";
import { Throttle } from "@/lib/endpoint-throttler-decorator";
@@ -46,6 +46,7 @@ const SCALE = "SCALE";
@DocsTags("Managed Orgs")
@ApiHeader(X_CAL_CLIENT_ID_HEADER)
@ApiHeader(X_CAL_SECRET_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsOrganizationsController {
constructor(private readonly managedOrganizationsService: ManagedOrganizationsService) {}
@@ -28,7 +28,7 @@ import {
HttpStatus,
Query,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
import {
@@ -50,6 +50,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsSchedulesController {
constructor(
private schedulesService: SchedulesService_2024_06_11,
@@ -33,7 +33,7 @@ import {
Redirect,
BadRequestException,
} from "@nestjs/common";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { Request } from "express";
import { stringify } from "querystring";
@@ -54,6 +54,7 @@ export type OAuthCallbackState = {
version: API_VERSIONS_VALUES,
})
@DocsTags("Orgs / Teams / Stripe")
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsStripeController {
constructor(
private readonly organizationsStripeService: OrganizationsStripeService,
@@ -23,7 +23,7 @@ import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
import { GetOrganizationsTeamsBookingsInput_2024_08_13 } from "@/modules/organizations/teams/bookings/inputs/get-organizations-teams-bookings.input";
import { UserWithProfile } from "@/modules/users/users.repository";
import { Controller, UseGuards, Get, Param, ParseIntPipe, Query, HttpStatus, HttpCode } from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS, BOOKING_READ } from "@calcom/platform-constants";
import { GetBookingsOutput_2024_08_13 } from "@calcom/platform-types";
@@ -37,6 +37,8 @@ import { GetBookingsOutput_2024_08_13 } from "@calcom/platform-types";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
@ApiParam({ name: "teamId", type: Number, required: true })
export class OrganizationsTeamsBookingsController {
constructor(
private readonly bookingsService: BookingsService_2024_08_13,
@@ -14,7 +14,7 @@ import {
Req,
UseGuards,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { Request } from "express";
import { API_VERSIONS_VALUES } from "@/lib/api-versions";
@@ -55,6 +55,7 @@ import { UserWithProfile } from "@/modules/users/users.repository";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsTeamsController {
constructor(
private organizationsTeamsService: OrganizationsTeamsService,
@@ -110,6 +111,7 @@ export class OrganizationsTeamsController {
@PlatformPlan("ESSENTIALS")
@Get("/:teamId")
@ApiOperation({ summary: "Get a team" })
@ApiParam({ name: "teamId", type: Number, required: true })
async getTeam(@GetTeam() team: Team): Promise<OrgTeamOutputResponseDto> {
return {
status: SUCCESS_STATUS,
@@ -28,7 +28,7 @@ import {
Body,
Req,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags } from "@nestjs/swagger";
import { Request } from "express";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -48,6 +48,9 @@ import { SUCCESS_STATUS } from "@calcom/platform-constants";
IsAdminAPIEnabledGuard
)
@ApiHeader(API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
@ApiParam({ name: "teamId", type: Number, required: true })
@ApiParam({ name: "routingFormId", type: String, required: true })
export class OrganizationsTeamsRoutingFormsResponsesController {
constructor(
private readonly organizationsTeamsRoutingFormsResponsesService: OrganizationsTeamsRoutingFormsResponsesService
@@ -38,7 +38,7 @@ import {
Query,
UseGuards,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -49,6 +49,8 @@ import { SkipTakePagination } from "@calcom/platform-types";
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@ApiTags("Organization Team Verified Resources")
@ApiParam({ name: "orgId", type: Number, required: true })
@ApiParam({ name: "teamId", type: Number, required: true })
export class OrgTeamsVerifiedResourcesController {
constructor(private readonly verifiedResourcesService: VerifiedResourcesService) {}
@ApiOperation({
@@ -42,7 +42,7 @@ import {
Body,
Delete,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
import { SkipTakePagination } from "@calcom/platform-types";
@@ -56,6 +56,8 @@ import { SkipTakePagination } from "@calcom/platform-types";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
@ApiParam({ name: "teamId", type: Number, required: true })
export class OrganizationTeamWorkflowsController {
constructor(
private readonly eventTypeWorkflowsService: TeamEventTypeWorkflowsService,
@@ -38,7 +38,7 @@ import {
Query,
} from "@nestjs/common";
import { ClassSerializerInterceptor } from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToInstance } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -55,6 +55,7 @@ import type { Team } from "@calcom/prisma/client";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsUsersController {
constructor(private readonly organizationsUsersService: OrganizationsUsersService) {}
@@ -40,7 +40,7 @@ import {
Query,
} from "@nestjs/common";
import { ClassSerializerInterceptor } from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToInstance } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -56,6 +56,7 @@ import { SUCCESS_STATUS } from "@calcom/platform-constants";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsUsersOOOController {
constructor(
private readonly userOOOService: UserOOOService,
@@ -119,6 +120,7 @@ export class OrganizationsUsersOOOController {
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg, IsUserOOO)
@ApiOperation({ summary: "Delete an out-of-office entry for a user" })
@ApiParam({ name: "userId", type: Number, required: true })
async deleteOrganizationUserOOO(
@Param("oooId", ParseIntPipe) oooId: number
): Promise<UserOooOutputResponseDto> {
@@ -37,7 +37,7 @@ import {
HttpCode,
HttpStatus,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -52,6 +52,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
@ApiHeader(OPTIONAL_API_KEY_HEADER)
@ApiParam({ name: "orgId", type: Number, required: true })
export class OrganizationsWebhooksController {
constructor(
private organizationsWebhooksService: OrganizationsWebhooksService,
@@ -41,6 +41,8 @@ import { WebhooksService } from "@/modules/webhooks/services/webhooks.service";
@UseGuards(ApiAuthGuard, RolesGuard, IsTeamEventTypeWebhookGuard)
@DocsTags("Teams / Event Types / Webhooks")
@ApiHeader(API_KEY_HEADER)
@ApiParam({ name: "teamId", type: Number, required: true })
@ApiParam({ name: "eventTypeId", type: Number, required: true })
export class TeamsEventTypesWebhooksController {
constructor(
private readonly webhooksService: WebhooksService,
@@ -32,7 +32,7 @@ import {
NotFoundException,
Query,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
import { handleCreatePhoneCall } from "@calcom/platform-libraries";
@@ -54,6 +54,7 @@ export type EventTypeHandlerResponse = {
version: API_VERSIONS_VALUES,
})
@DocsTags("Teams / Event Types")
@ApiParam({ name: "teamId", type: Number, required: true })
export class TeamsEventTypesController {
constructor(
private readonly teamsEventTypesService: TeamsEventTypesService,
@@ -33,7 +33,7 @@ import {
Query,
UseGuards,
} from "@nestjs/common";
import { ApiHeader, ApiOperation, ApiTags } from "@nestjs/swagger";
import { ApiHeader, ApiOperation, ApiParam, ApiTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -44,6 +44,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
})
@UseGuards(ApiAuthGuard, RolesGuard)
@ApiTags("Teams Verified Resources")
@ApiParam({ name: "teamId", type: Number, required: true })
export class TeamsVerifiedResourcesController {
constructor(private readonly verifiedResourcesService: VerifiedResourcesService) {}
@ApiOperation({