diff --git a/json-schema/json-schema.json b/json-schema/json-schema.json index 1ae113fddf..f6a197e4a5 100644 --- a/json-schema/json-schema.json +++ b/json-schema/json-schema.json @@ -36,7 +36,7 @@ "users": { "type": "array", "items": { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" } }, "userId": { @@ -45,7 +45,7 @@ "team": { "anyOf": [ { - "$ref": "#/definitions/Team" + "$ref": "#/components/schemas/Team" }, { "type": "null" @@ -55,25 +55,25 @@ "bookings": { "type": "array", "items": { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" } }, "availability": { "type": "array", "items": { - "$ref": "#/definitions/Availability" + "$ref": "#/components/schemas/Availability" } }, "webhooks": { "type": "array", "items": { - "$ref": "#/definitions/Webhook" + "$ref": "#/components/schemas/Webhook" } }, "destinationCalendar": { "anyOf": [ { - "$ref": "#/definitions/DestinationCalendar" + "$ref": "#/components/schemas/DestinationCalendar" }, { "type": "null" @@ -86,7 +86,7 @@ "customInputs": { "type": "array", "items": { - "$ref": "#/definitions/EventTypeCustomInput" + "$ref": "#/components/schemas/EventTypeCustomInput" } }, "timeZone": { @@ -138,7 +138,7 @@ "schedule": { "anyOf": [ { - "$ref": "#/definitions/Schedule" + "$ref": "#/components/schemas/Schedule" }, { "type": "null" @@ -176,7 +176,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -200,7 +200,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -210,7 +210,7 @@ "booking": { "anyOf": [ { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, { "type": "null" @@ -220,7 +220,7 @@ "eventType": { "anyOf": [ { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, { "type": "null" @@ -296,31 +296,31 @@ "eventTypes": { "type": "array", "items": { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" } }, "credentials": { "type": "array", "items": { - "$ref": "#/definitions/Credential" + "$ref": "#/components/schemas/Credential" } }, "teams": { "type": "array", "items": { - "$ref": "#/definitions/Membership" + "$ref": "#/components/schemas/Membership" } }, "bookings": { "type": "array", "items": { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" } }, "schedules": { "type": "array", "items": { - "$ref": "#/definitions/Schedule" + "$ref": "#/components/schemas/Schedule" } }, "defaultScheduleId": { @@ -329,7 +329,7 @@ "selectedCalendars": { "type": "array", "items": { - "$ref": "#/definitions/SelectedCalendar" + "$ref": "#/components/schemas/SelectedCalendar" } }, "completedOnboarding": { @@ -361,7 +361,7 @@ "availability": { "type": "array", "items": { - "$ref": "#/definitions/Availability" + "$ref": "#/components/schemas/Availability" } }, "invitedTo": { @@ -375,7 +375,7 @@ "webhooks": { "type": "array", "items": { - "$ref": "#/definitions/Webhook" + "$ref": "#/components/schemas/Webhook" } }, "brandColor": { @@ -389,7 +389,7 @@ "destinationCalendar": { "anyOf": [ { - "$ref": "#/definitions/DestinationCalendar" + "$ref": "#/components/schemas/DestinationCalendar" }, { "type": "null" @@ -410,7 +410,7 @@ "apiKeys": { "type": "array", "items": { - "$ref": "#/definitions/ApiKey" + "$ref": "#/components/schemas/ApiKey" } } } @@ -440,13 +440,13 @@ "members": { "type": "array", "items": { - "$ref": "#/definitions/Membership" + "$ref": "#/components/schemas/Membership" } }, "eventTypes": { "type": "array", "items": { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" } } } @@ -463,10 +463,10 @@ "enum": ["MEMBER", "ADMIN", "OWNER"] }, "team": { - "$ref": "#/definitions/Team" + "$ref": "#/components/schemas/Team" }, "user": { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" } } }, @@ -520,7 +520,7 @@ "booking": { "anyOf": [ { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, { "type": "null" @@ -551,7 +551,7 @@ "booking": { "anyOf": [ { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, { "type": "null" @@ -577,7 +577,7 @@ "booking": { "anyOf": [ { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, { "type": "null" @@ -598,7 +598,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -608,13 +608,13 @@ "references": { "type": "array", "items": { - "$ref": "#/definitions/BookingReference" + "$ref": "#/components/schemas/BookingReference" } }, "eventType": { "anyOf": [ { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, { "type": "null" @@ -638,7 +638,7 @@ "attendees": { "type": "array", "items": { - "$ref": "#/definitions/Attendee" + "$ref": "#/components/schemas/Attendee" } }, "location": { @@ -647,7 +647,7 @@ "dailyRef": { "anyOf": [ { - "$ref": "#/definitions/DailyEventReference" + "$ref": "#/components/schemas/DailyEventReference" }, { "type": "null" @@ -682,13 +682,13 @@ "payment": { "type": "array", "items": { - "$ref": "#/definitions/Payment" + "$ref": "#/components/schemas/Payment" } }, "destinationCalendar": { "anyOf": [ { - "$ref": "#/definitions/DestinationCalendar" + "$ref": "#/components/schemas/DestinationCalendar" }, { "type": "null" @@ -710,12 +710,12 @@ "type": "integer" }, "user": { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, "eventType": { "anyOf": [ { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, { "type": "null" @@ -731,7 +731,7 @@ "availability": { "type": "array", "items": { - "$ref": "#/definitions/Availability" + "$ref": "#/components/schemas/Availability" } } } @@ -745,7 +745,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -755,7 +755,7 @@ "eventType": { "anyOf": [ { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, { "type": "null" @@ -783,7 +783,7 @@ "Schedule": { "anyOf": [ { - "$ref": "#/definitions/Schedule" + "$ref": "#/components/schemas/Schedule" }, { "type": "null" @@ -796,7 +796,7 @@ "type": "object", "properties": { "user": { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, "integration": { "type": "string" @@ -813,7 +813,7 @@ "type": "integer" }, "eventType": { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, "label": { "type": "string" @@ -892,7 +892,7 @@ "booking": { "anyOf": [ { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, { "type": "null" @@ -949,7 +949,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -959,7 +959,7 @@ "eventType": { "anyOf": [ { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, { "type": "null" @@ -977,7 +977,7 @@ "user": { "anyOf": [ { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, { "type": "null" @@ -1001,64 +1001,64 @@ "type": "object", "properties": { "eventType": { - "$ref": "#/definitions/EventType" + "$ref": "#/components/schemas/EventType" }, "credential": { - "$ref": "#/definitions/Credential" + "$ref": "#/components/schemas/Credential" }, "destinationCalendar": { - "$ref": "#/definitions/DestinationCalendar" + "$ref": "#/components/schemas/DestinationCalendar" }, "user": { - "$ref": "#/definitions/User" + "$ref": "#/components/schemas/User" }, "team": { - "$ref": "#/definitions/Team" + "$ref": "#/components/schemas/Team" }, "membership": { - "$ref": "#/definitions/Membership" + "$ref": "#/components/schemas/Membership" }, "verificationRequest": { - "$ref": "#/definitions/VerificationRequest" + "$ref": "#/components/schemas/VerificationRequest" }, "bookingReference": { - "$ref": "#/definitions/BookingReference" + "$ref": "#/components/schemas/BookingReference" }, "attendee": { - "$ref": "#/definitions/Attendee" + "$ref": "#/components/schemas/Attendee" }, "dailyEventReference": { - "$ref": "#/definitions/DailyEventReference" + "$ref": "#/components/schemas/DailyEventReference" }, "booking": { - "$ref": "#/definitions/Booking" + "$ref": "#/components/schemas/Booking" }, "schedule": { - "$ref": "#/definitions/Schedule" + "$ref": "#/components/schemas/Schedule" }, "availability": { - "$ref": "#/definitions/Availability" + "$ref": "#/components/schemas/Availability" }, "selectedCalendar": { - "$ref": "#/definitions/SelectedCalendar" + "$ref": "#/components/schemas/SelectedCalendar" }, "eventTypeCustomInput": { - "$ref": "#/definitions/EventTypeCustomInput" + "$ref": "#/components/schemas/EventTypeCustomInput" }, "resetPasswordRequest": { - "$ref": "#/definitions/ResetPasswordRequest" + "$ref": "#/components/schemas/ResetPasswordRequest" }, "reminderMail": { - "$ref": "#/definitions/ReminderMail" + "$ref": "#/components/schemas/ReminderMail" }, "payment": { - "$ref": "#/definitions/Payment" + "$ref": "#/components/schemas/Payment" }, "webhook": { - "$ref": "#/definitions/Webhook" + "$ref": "#/components/schemas/Webhook" }, "apiKey": { - "$ref": "#/definitions/ApiKey" + "$ref": "#/components/schemas/ApiKey" } } } diff --git a/pages/api/attendees/[id].ts b/pages/api/attendees/[id].ts index ce41228cd0..b27c2e40fb 100644 --- a/pages/api/attendees/[id].ts +++ b/pages/api/attendees/[id].ts @@ -23,8 +23,7 @@ import { * required: true * description: Numeric ID of the attendee to get * example: 3 - * security: - * - ApiKeyAuth: [] + * tags: * - attendees * responses: @@ -36,8 +35,6 @@ import { * description: Attendee was not found * patch: * summary: Edit an existing attendee - * consumes: - * - application/json * requestBody: * description: Edit an existing attendee related to one of your bookings * required: true @@ -68,14 +65,12 @@ import { * example: 3 * required: true * description: Numeric ID of the attendee to edit - * security: - * - ApiKeyAuth: [] + * tags: * - attendees * responses: * 201: * description: OK, attendee edited successfuly - * model: Attendee * 400: * description: Bad request. Attendee body is invalid. * 401: @@ -89,14 +84,12 @@ import { * type: integer * required: true * description: Numeric ID of the attendee to delete - * security: - * - ApiKeyAuth: [] + * tags: * - attendees * responses: * 201: * description: OK, attendee removed successfuly - * model: Attendee * 400: * description: Bad request. Attendee id is invalid. * 401: diff --git a/pages/api/attendees/index.ts b/pages/api/attendees/index.ts index 3adbc8a78c..a0514bb8df 100644 --- a/pages/api/attendees/index.ts +++ b/pages/api/attendees/index.ts @@ -11,8 +11,7 @@ import { schemaAttendeeCreateBodyParams, schemaAttendeeReadPublic } from "@lib/v * /attendees: * get: * summary: Find all attendees - * security: - * - ApiKeyAuth: [] + * tags: * - attendees * responses: @@ -24,10 +23,7 @@ import { schemaAttendeeCreateBodyParams, schemaAttendeeReadPublic } from "@lib/v * description: No attendees were found * post: * summary: Creates a new attendee - * security: - * - ApiKeyAuth: [] - * consumes: - * - application/json + * requestBody: * description: Create a new attendee related to one of your bookings * required: true @@ -58,7 +54,6 @@ import { schemaAttendeeCreateBodyParams, schemaAttendeeReadPublic } from "@lib/v * responses: * 201: * description: OK, attendee created - * model: Attendee * 400: * description: Bad request. Attendee body is invalid. * 401: diff --git a/pages/api/availabilities/[id].ts b/pages/api/availabilities/[id].ts index 65f750dba7..ad6826a6d3 100644 --- a/pages/api/availabilities/[id].ts +++ b/pages/api/availabilities/[id].ts @@ -25,8 +25,7 @@ import { * type: integer * required: true * description: Numeric ID of the availability to get - * security: - * - ApiKeyAuth: [] + * tags: * - availabilities * externalDocs: @@ -40,24 +39,14 @@ import { * description: Availability was not found * patch: * summary: Edit an existing availability - * consumes: - * - application/json * parameters: - * - in: body - * name: availability - * description: The availability to edit - * schema: - * type: object - * $ref: '#/components/schemas/Availability' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the availability to edit - * security: - * - ApiKeyAuth: [] + * tags: * - availabilities * externalDocs: @@ -65,7 +54,6 @@ import { * responses: * 201: * description: OK, availability edited successfuly - * model: Availability * 400: * description: Bad request. Availability body is invalid. * 401: @@ -79,8 +67,7 @@ import { * type: integer * required: true * description: Numeric ID of the availability to delete - * security: - * - ApiKeyAuth: [] + * tags: * - availabilities * externalDocs: @@ -88,7 +75,6 @@ import { * responses: * 201: * description: OK, availability removed successfuly - * model: Availability * 400: * description: Bad request. Availability id is invalid. * 401: diff --git a/pages/api/availabilities/index.ts b/pages/api/availabilities/index.ts index 3e519bc6ad..7d8f18eac3 100644 --- a/pages/api/availabilities/index.ts +++ b/pages/api/availabilities/index.ts @@ -14,8 +14,7 @@ import { * /availabilities: * get: * summary: Find all availabilities - * security: - * - ApiKeyAuth: [] + * tags: * - availabilities * externalDocs: @@ -29,8 +28,7 @@ import { * description: No availabilities were found * post: * summary: Creates a new availability - * security: - * - ApiKeyAuth: [] + * tags: * - availabilities * externalDocs: @@ -38,7 +36,6 @@ import { * responses: * 201: * description: OK, availability created - * model: Availability * 400: * description: Bad request. Availability body is invalid. * 401: diff --git a/pages/api/booking-references/[id].ts b/pages/api/booking-references/[id].ts index 21b314f728..4014707eb4 100644 --- a/pages/api/booking-references/[id].ts +++ b/pages/api/booking-references/[id].ts @@ -26,8 +26,7 @@ import { * type: integer * required: true * description: Numeric ID of the booking reference to get - * security: - * - ApiKeyAuth: [] + * tags: * - booking-references * responses: @@ -39,30 +38,20 @@ import { * description: BookingReference was not found * patch: * summary: Edit an existing booking reference - * consumes: - * - application/json + * parameters: - * - in: body - * name: bookingReference - * description: The bookingReference to edit - * schema: - * type: object - * $ref: '#/components/schemas/BookingReference' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the booking reference to edit - * security: - * - ApiKeyAuth: [] + * tags: * - booking-references * responses: * 201: * description: OK, bookingReference edited successfuly - * model: BookingReference * 400: * description: Bad request. BookingReference body is invalid. * 401: @@ -76,14 +65,12 @@ import { * type: integer * required: true * description: Numeric ID of the booking reference to delete - * security: - * - ApiKeyAuth: [] + * tags: * - booking-references * responses: * 201: * description: OK, bookingReference removed successfuly - * model: BookingReference * 400: * description: Bad request. BookingReference id is invalid. * 401: diff --git a/pages/api/booking-references/index.ts b/pages/api/booking-references/index.ts index bc82f23701..c214b305db 100644 --- a/pages/api/booking-references/index.ts +++ b/pages/api/booking-references/index.ts @@ -14,8 +14,7 @@ import { * /booking-references: * get: * summary: Find all booking references - * security: - * - ApiKeyAuth: [] + * tags: * - booking-references * responses: @@ -27,14 +26,13 @@ import { * description: No booking references were found * post: * summary: Creates a new booking reference - * security: - * - ApiKeyAuth: [] + * tags: * - booking-references * responses: * 201: * description: OK, booking reference created - * model: BookingReference + * 400: * description: Bad request. BookingReference body is invalid. * 401: diff --git a/pages/api/bookings/[id].ts b/pages/api/bookings/[id].ts index 21be432cd1..9c1b647b20 100644 --- a/pages/api/bookings/[id].ts +++ b/pages/api/bookings/[id].ts @@ -22,8 +22,7 @@ import { * type: integer * required: true * description: Numeric ID of the booking to get - * security: - * - ApiKeyAuth: [] + * tags: * - bookings * responses: @@ -35,30 +34,20 @@ import { * description: Booking was not found * patch: * summary: Edit an existing booking - * consumes: - * - application/json + * parameters: - * - in: body - * name: booking - * description: The booking to edit - * schema: - * type: object - * $ref: '#/components/schemas/Booking' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the booking to edit - * security: - * - ApiKeyAuth: [] + * tags: * - bookings * responses: * 201: * description: OK, booking edited successfuly - * model: Booking * 400: * description: Bad request. Booking body is invalid. * 401: @@ -72,14 +61,12 @@ import { * type: integer * required: true * description: Numeric ID of the booking to delete - * security: - * - ApiKeyAuth: [] + * tags: * - bookings * responses: * 201: * description: OK, booking removed successfuly - * model: Booking * 400: * description: Bad request. Booking id is invalid. * 401: diff --git a/pages/api/bookings/index.ts b/pages/api/bookings/index.ts index 8bb9cae30d..311a79b4dd 100644 --- a/pages/api/bookings/index.ts +++ b/pages/api/bookings/index.ts @@ -11,8 +11,7 @@ import { schemaBookingCreateBodyParams, schemaBookingReadPublic } from "@lib/val * /bookings: * get: * summary: Find all bookings - * security: - * - ApiKeyAuth: [] + * tags: * - bookings * responses: @@ -24,14 +23,12 @@ import { schemaBookingCreateBodyParams, schemaBookingReadPublic } from "@lib/val * description: No bookings were found * post: * summary: Creates a new booking - * security: - * - ApiKeyAuth: [] + * tags: * - bookings * responses: * 201: * description: OK, booking created - * model: Booking * 400: * description: Bad request. Booking body is invalid. * 401: diff --git a/pages/api/daily-event-references/[id].ts b/pages/api/daily-event-references/[id].ts index 6ef4ac01e2..a59beeebbf 100644 --- a/pages/api/daily-event-references/[id].ts +++ b/pages/api/daily-event-references/[id].ts @@ -25,8 +25,7 @@ import { * type: integer * required: true * description: Numeric ID of the daily event reference to get - * security: - * - ApiKeyAuth: [] + * tags: * - daily-event-references * responses: @@ -38,30 +37,20 @@ import { * description: DailyEventReference was not found * patch: * summary: Edit an existing daily event reference - * consumes: - * - application/json + * parameters: - * - in: body - * name: dailyEventReference - * description: The dailyEventReference to edit - * schema: - * type: object - * $ref: '#/components/schemas/DailyEventReference' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the daily event reference to edit - * security: - * - ApiKeyAuth: [] + * tags: * - daily-event-references * responses: * 201: * description: OK, dailyEventReference edited successfuly - * model: DailyEventReference * 400: * description: Bad request. DailyEventReference body is invalid. * 401: @@ -75,14 +64,12 @@ import { * type: integer * required: true * description: Numeric ID of the daily event reference to delete - * security: - * - ApiKeyAuth: [] + * tags: * - daily-event-references * responses: * 201: * description: OK, dailyEventReference removed successfuly - * model: DailyEventReference * 400: * description: Bad request. DailyEventReference id is invalid. * 401: diff --git a/pages/api/daily-event-references/index.ts b/pages/api/daily-event-references/index.ts index dfafe246ce..290469f307 100644 --- a/pages/api/daily-event-references/index.ts +++ b/pages/api/daily-event-references/index.ts @@ -14,8 +14,7 @@ import { * /daily-event-references: * get: * summary: Find all daily event reference - * security: - * - ApiKeyAuth: [] + * tags: * - daily-event-references * responses: @@ -27,14 +26,12 @@ import { * description: No daily event references were found * post: * summary: Creates a new daily event reference - * security: - * - ApiKeyAuth: [] + * tags: * - daily-event-references * responses: * 201: * description: OK, daily event reference created - * model: DailyEventReference * 400: * description: Bad request. DailyEventReference body is invalid. * 401: diff --git a/pages/api/destination-calendars/[id].ts b/pages/api/destination-calendars/[id].ts index 60982a7058..ecfe646b09 100644 --- a/pages/api/destination-calendars/[id].ts +++ b/pages/api/destination-calendars/[id].ts @@ -25,8 +25,7 @@ import { * type: integer * required: true * description: Numeric ID of the destination calendar to get - * security: - * - ApiKeyAuth: [] + * tags: * - destination-calendars * responses: @@ -38,30 +37,20 @@ import { * description: DestinationCalendar was not found * patch: * summary: Edit an existing destination calendar - * consumes: - * - application/json + * parameters: - * - in: body - * name: destinationCalendar - * description: The destinationCalendar to edit - * schema: - * type: object - * $ref: '#/components/schemas/DestinationCalendar' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the destination calendar to edit - * security: - * - ApiKeyAuth: [] + * tags: * - destination-calendars * responses: * 201: * description: OK, destinationCalendar edited successfuly - * model: DestinationCalendar * 400: * description: Bad request. DestinationCalendar body is invalid. * 401: @@ -75,14 +64,12 @@ import { * type: integer * required: true * description: Numeric ID of the destination calendar to delete - * security: - * - ApiKeyAuth: [] + * tags: * - destination-calendars * responses: * 201: * description: OK, destinationCalendar removed successfuly - * model: DestinationCalendar * 400: * description: Bad request. DestinationCalendar id is invalid. * 401: diff --git a/pages/api/destination-calendars/index.ts b/pages/api/destination-calendars/index.ts index d7921491c9..cf33e0fa58 100644 --- a/pages/api/destination-calendars/index.ts +++ b/pages/api/destination-calendars/index.ts @@ -14,8 +14,7 @@ import { * /destination-calendars: * get: * summary: Find all destination calendars - * security: - * - ApiKeyAuth: [] + * tags: * - destination-calendars * responses: @@ -27,14 +26,12 @@ import { * description: No destination calendars were found * post: * summary: Creates a new destination calendar - * security: - * - ApiKeyAuth: [] + * tags: * - destination-calendars * responses: * 201: * description: OK, destination calendar created - * model: DestinationCalendar * 400: * description: Bad request. DestinationCalendar body is invalid. * 401: diff --git a/pages/api/docs.ts b/pages/api/docs.ts index 7dd7afa65d..356967d4a2 100644 --- a/pages/api/docs.ts +++ b/pages/api/docs.ts @@ -20,26 +20,9 @@ const swaggerHandler = withSwagger({ }, components: { securitySchemes: { ApiKeyAuth: { type: "apiKey", in: "query", name: "apiKey" } }, - security: { ApiKeyAuth: [] }, - schemas: { ...jsonSchema.definitions }, }, + security: [{ apiKey: [] }], }, apiFolder: "pages/api", - tags: [ - "users", - "teams", - "memeberships", - "selected-calendars", - "schedules", - "payments", - "event-types", - "event-type-custom-inputs", - "destination-calendars", - "daily-event-references", - "booking-references", - "availabilities", - "attendees", - ], - sort: true, }); export default swaggerHandler(); diff --git a/pages/api/event-type-custom-inputs/[id].ts b/pages/api/event-type-custom-inputs/[id].ts index 7d3ffa7a5d..6760e4b39c 100644 --- a/pages/api/event-type-custom-inputs/[id].ts +++ b/pages/api/event-type-custom-inputs/[id].ts @@ -25,8 +25,7 @@ import { * type: integer * required: true * description: Numeric ID of the eventTypeCustomInput to get - * security: - * - ApiKeyAuth: [] + * tags: * - event-type-custom-inputs * responses: @@ -35,35 +34,25 @@ import { * 401: * description: Authorization information is missing or invalid. * 404: - * deCustomInputscription: EventType was not found + * description: EventType was not found * patch: * summary: Edit an existing eventTypeCustomInput - * consumes: - * - application/json + * parameters: - * - in: body - * name: eventTypeCustomInput - * description: The eventTypeCustomInput to edit - * schema: - * type: object - * $ref: '#/components/schemas/EventTypeCustomInput' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the eventTypeCustomInput to edit - * security: - * - ApiKeyAuth: [] + * tags: * - event-type-custom-inputs * responses: * 201: * description: OK, eventTypeCustomInput edited successfuly - * model: EventTypeCustomInput * 400: - * desCustomInputcription: Bad request. EventType body is invalid. + * description: Bad request. EventType body is invalid. * 401: * description: Authorization information is missing or invalid. * delete: @@ -75,16 +64,14 @@ import { * type: integer * required: true * description: Numeric ID of the eventTypeCustomInput to delete - * security: - * - ApiKeyAuth: [] + * tags: * - event-type-custom-inputs * responses: * 201: * description: OK, eventTypeCustomInput removed successfuly - * model: EventTypeCustomInput * 400: - * desCustomInputcription: Bad request. EventType id is invalid. + * description: Bad request. EventType id is invalid. * 401: * description: Authorization information is missing or invalid. */ diff --git a/pages/api/event-type-custom-inputs/index.ts b/pages/api/event-type-custom-inputs/index.ts index 01f5af921f..e7cc037cd9 100644 --- a/pages/api/event-type-custom-inputs/index.ts +++ b/pages/api/event-type-custom-inputs/index.ts @@ -14,8 +14,7 @@ import { * /event-type-custom-inputs: * get: * summary: Find all eventTypeCustomInputs - * security: - * - ApiKeyAuth: [] + * tags: * - event-type-custom-inputs * responses: @@ -27,14 +26,12 @@ import { * description: No eventTypeCustomInputs were found * post: * summary: Creates a new eventTypeCustomInput - * security: - * - ApiKeyAuth: [] + * tags: * - event-type-custom-inputs * responses: * 201: * description: OK, eventTypeCustomInput created - * model: EventTypeCustomInput * 400: * description: Bad request. EventTypeCustomInput body is invalid. * 401: diff --git a/pages/api/event-types/[id].ts b/pages/api/event-types/[id].ts index 37a5b38be7..ebb440bd37 100644 --- a/pages/api/event-types/[id].ts +++ b/pages/api/event-types/[id].ts @@ -37,16 +37,7 @@ import { * description: EventType was not found * patch: * summary: Edit an existing eventType - * consumes: - * - application/json * parameters: - * - in: body - * name: eventType - * description: The eventType to edit - * schema: - * type: object - * $ref: '#/components/schemas/EventType' - * required: true * - in: path * name: id * schema: @@ -62,7 +53,6 @@ import { * responses: * 201: * description: OK, eventType edited successfuly - * model: EventType * 400: * description: Bad request. EventType body is invalid. * 401: @@ -85,7 +75,6 @@ import { * responses: * 201: * description: OK, eventType removed successfuly - * model: EventType * 400: * description: Bad request. EventType id is invalid. * 401: diff --git a/pages/api/event-types/index.ts b/pages/api/event-types/index.ts index 9e1e83c038..eb6c7d1290 100644 --- a/pages/api/event-types/index.ts +++ b/pages/api/event-types/index.ts @@ -11,8 +11,7 @@ import { schemaEventTypeBodyParams, schemaEventTypePublic } from "@lib/validatio * /event-types: * get: * summary: Find all event types - * security: - * - ApiKeyAuth: [] + * tags: * - event-types * externalDocs: @@ -26,8 +25,7 @@ import { schemaEventTypeBodyParams, schemaEventTypePublic } from "@lib/validatio * description: No event types were found * post: * summary: Creates a new event type - * security: - * - ApiKeyAuth: [] + * tags: * - event-types * externalDocs: @@ -35,7 +33,6 @@ import { schemaEventTypeBodyParams, schemaEventTypePublic } from "@lib/validatio * responses: * 201: * description: OK, event type created - * model: EventType * 400: * description: Bad request. EventType body is invalid. * 401: diff --git a/pages/api/index.ts b/pages/api/index.ts index 3f72b7eaef..94461cedce 100644 --- a/pages/api/index.ts +++ b/pages/api/index.ts @@ -1,10 +1,5 @@ import type { NextApiRequest, NextApiResponse } from "next"; -/** - * @swagger - * security: - * - ApiKeyAuth: [] - */ export default async function CalcomApi(_: NextApiRequest, res: NextApiResponse) { res.status(201).json({ message: "Welcome to Cal.com API - docs are at https://docs.cal.com/api" }); } diff --git a/pages/api/memberships/[id].ts b/pages/api/memberships/[id].ts index 0e7498d16c..3172428ec3 100644 --- a/pages/api/memberships/[id].ts +++ b/pages/api/memberships/[id].ts @@ -25,8 +25,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: integer * required: true * description: Numeric teamId of the membership to get - * security: - * - ApiKeyAuth: [] + * tags: * - memberships * responses: @@ -38,16 +37,8 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * description: Membership was not found * patch: * summary: Edit an existing membership - * consumes: - * - application/json + * parameters: - * - in: body - * name: membership - * description: The membership to edit - * schema: - * type: object - * $ref: '#/components/schemas/Membership' - * required: true * - in: path * name: userId * schema: @@ -60,14 +51,12 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: integer * required: true * description: Numeric teamId of the membership to get - * security: - * - ApiKeyAuth: [] + * tags: * - memberships * responses: * 201: * description: OK, membership edited successfuly - * model: Membership * 400: * description: Bad request. Membership body is invalid. * 401: @@ -87,14 +76,12 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: integer * required: true * description: Numeric teamId of the membership to get - * security: - * - ApiKeyAuth: [] + * tags: * - memberships * responses: * 201: * description: OK, membership removed successfuly - * model: Membership * 400: * description: Bad request. Membership id is invalid. * 401: diff --git a/pages/api/memberships/index.ts b/pages/api/memberships/index.ts index 3df3b56d13..78072dd68d 100644 --- a/pages/api/memberships/index.ts +++ b/pages/api/memberships/index.ts @@ -11,8 +11,7 @@ import { schemaMembershipBodyParams, schemaMembershipPublic } from "@lib/validat * /memberships: * get: * summary: Find all memberships - * security: - * - ApiKeyAuth: [] + * tags: * - memberships * responses: @@ -24,14 +23,12 @@ import { schemaMembershipBodyParams, schemaMembershipPublic } from "@lib/validat * description: No memberships were found * post: * summary: Creates a new membership - * security: - * - ApiKeyAuth: [] + * tags: * - memberships * responses: * 201: * description: OK, membership created - * model: Membership * 400: * description: Bad request. Membership body is invalid. * 401: diff --git a/pages/api/payments/[id].ts b/pages/api/payments/[id].ts index 8ab4d5eab9..9f0d8315dd 100644 --- a/pages/api/payments/[id].ts +++ b/pages/api/payments/[id].ts @@ -22,8 +22,7 @@ import { * type: integer * required: true * description: Numeric ID of the payment to get - * security: - * - ApiKeyAuth: [] + * tags: * - payments * responses: diff --git a/pages/api/payments/index.ts b/pages/api/payments/index.ts index db0cd349ca..5d16b911df 100644 --- a/pages/api/payments/index.ts +++ b/pages/api/payments/index.ts @@ -11,8 +11,7 @@ import { schemaPaymentPublic } from "@lib/validations/payment"; * /payments: * get: * summary: Find all payments - * security: - * - ApiKeyAuth: [] + * tags: * - payments * responses: diff --git a/pages/api/schedules/[id].ts b/pages/api/schedules/[id].ts index 8a08128f4f..a2d9da0366 100644 --- a/pages/api/schedules/[id].ts +++ b/pages/api/schedules/[id].ts @@ -22,8 +22,7 @@ import { * type: integer * required: true * description: Numeric ID of the schedule to get - * security: - * - ApiKeyAuth: [] + * tags: * - schedules * responses: @@ -35,30 +34,21 @@ import { * description: Schedule was not found * patch: * summary: Edit an existing schedule - * consumes: - * - application/json + * parameters: - * - in: body - * name: schedule - * description: The schedule to edit - * schema: - * type: object - * $ref: '#/components/schemas/Schedule' - * required: true + * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the schedule to edit - * security: - * - ApiKeyAuth: [] + * tags: * - schedules * responses: * 201: * description: OK, schedule edited successfuly - * model: Schedule * 400: * description: Bad request. Schedule body is invalid. * 401: @@ -72,14 +62,12 @@ import { * type: integer * required: true * description: Numeric ID of the schedule to delete - * security: - * - ApiKeyAuth: [] + * tags: * - schedules * responses: * 201: * description: OK, schedule removed successfuly - * model: Schedule * 400: * description: Bad request. Schedule id is invalid. * 401: diff --git a/pages/api/schedules/index.ts b/pages/api/schedules/index.ts index 228599eef3..29fe160340 100644 --- a/pages/api/schedules/index.ts +++ b/pages/api/schedules/index.ts @@ -11,8 +11,7 @@ import { schemaScheduleBodyParams, schemaSchedulePublic } from "@lib/validations * /schedules: * get: * summary: Find all schedules - * security: - * - ApiKeyAuth: [] + * tags: * - schedules * responses: @@ -24,14 +23,12 @@ import { schemaScheduleBodyParams, schemaSchedulePublic } from "@lib/validations * description: No schedules were found * post: * summary: Creates a new schedule - * security: - * - ApiKeyAuth: [] + * tags: * - schedules * responses: * 201: * description: OK, schedule created - * model: Schedule * 400: * description: Bad request. Schedule body is invalid. * 401: diff --git a/pages/api/selected-calendars/[id].ts b/pages/api/selected-calendars/[id].ts index 6efbca86ee..b3df3b88b2 100644 --- a/pages/api/selected-calendars/[id].ts +++ b/pages/api/selected-calendars/[id].ts @@ -34,8 +34,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: string * required: true * description: integration of the selected calendar to get - * security: - * - ApiKeyAuth: [] + * tags: * - selected-calendars * responses: @@ -47,16 +46,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * description: SelectedCalendar was not found * patch: * summary: Edit an existing selected calendar - * consumes: - * - application/json * parameters: - * - in: body - * name: selected-calendar - * description: The selected-calendar to edit - * schema: - * type: object - * $ref: '#/components/schemas/SelectedCalendar' - * required: true * - in: path * name: userId * schema: @@ -75,14 +65,12 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: string * required: true * description: integration of the selected calendar to get - * security: - * - ApiKeyAuth: [] + * tags: * - selected-calendars * responses: * 201: * description: OK, selected-calendar edited successfuly - * model: SelectedCalendar * 400: * description: Bad request. SelectedCalendar body is invalid. * 401: @@ -108,14 +96,12 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/ * type: string * required: true * description: integration of the selected calendar to get - * security: - * - ApiKeyAuth: [] + * tags: * - selected-calendars * responses: * 201: * description: OK, selected-calendar removed successfuly - * model: SelectedCalendar * 400: * description: Bad request. SelectedCalendar id is invalid. * 401: diff --git a/pages/api/selected-calendars/index.ts b/pages/api/selected-calendars/index.ts index 83537208ba..055ae51346 100644 --- a/pages/api/selected-calendars/index.ts +++ b/pages/api/selected-calendars/index.ts @@ -14,8 +14,7 @@ import { * /selected-calendars: * get: * summary: Find all selected calendars - * security: - * - ApiKeyAuth: [] + * tags: * - selected-calendars * responses: @@ -27,14 +26,12 @@ import { * description: No selected calendars were found * post: * summary: Creates a new selected calendar - * security: - * - ApiKeyAuth: [] + * tags: * - selected-calendars * responses: * 201: * description: OK, selected calendar created - * model: SelectedCalendar * 400: * description: Bad request. SelectedCalendar body is invalid. * 401: diff --git a/pages/api/teams/[id].ts b/pages/api/teams/[id].ts index 0fead8e066..9fb11b5e50 100644 --- a/pages/api/teams/[id].ts +++ b/pages/api/teams/[id].ts @@ -22,8 +22,7 @@ import { schemaTeamBodyParams, schemaTeamPublic } from "@lib/validations/team"; * type: integer * required: true * description: Numeric ID of the team to get - * security: - * - ApiKeyAuth: [] + * tags: * - teams * responses: @@ -33,36 +32,27 @@ import { schemaTeamBodyParams, schemaTeamPublic } from "@lib/validations/team"; * description: Authorization information is missing or invalid. * 404: * description: Team was not found + * patch: * summary: Edit an existing team - * consumes: - * - application/json * parameters: - * - in: body - * name: team - * description: The team to edit - * schema: - * type: object - * $ref: '#/components/schemas/Team' - * required: true * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the team to edit - * security: - * - ApiKeyAuth: [] + * tags: * - teams * responses: * 201: * description: OK, team edited successfuly - * model: Team * 400: * description: Bad request. Team body is invalid. * 401: * description: Authorization information is missing or invalid. + * delete: * summary: Remove an existing team * parameters: @@ -72,14 +62,12 @@ import { schemaTeamBodyParams, schemaTeamPublic } from "@lib/validations/team"; * type: integer * required: true * description: Numeric ID of the team to delete - * security: - * - ApiKeyAuth: [] + * tags: * - teams * responses: * 201: * description: OK, team removed successfuly - * model: Team * 400: * description: Bad request. Team id is invalid. * 401: diff --git a/pages/api/teams/index.ts b/pages/api/teams/index.ts index ce335fff9d..11d646f70f 100644 --- a/pages/api/teams/index.ts +++ b/pages/api/teams/index.ts @@ -12,8 +12,7 @@ import { schemaTeamBodyParams, schemaTeamPublic } from "@lib/validations/team"; * /teams: * get: * summary: Find all teams - * security: - * - ApiKeyAuth: [] + * tags: * - teams * responses: @@ -25,14 +24,12 @@ import { schemaTeamBodyParams, schemaTeamPublic } from "@lib/validations/team"; * description: No teams were found * post: * summary: Creates a new team - * security: - * - ApiKeyAuth: [] + * tags: * - teams * responses: * 201: * description: OK, team created - * model: Team * 400: * description: Bad request. Team body is invalid. * 401: diff --git a/pages/api/users/[id].ts b/pages/api/users/[id].ts index 06e5612dd0..f8aed85d7d 100644 --- a/pages/api/users/[id].ts +++ b/pages/api/users/[id].ts @@ -22,8 +22,7 @@ import { schemaUserEditBodyParams, schemaUserReadPublic } from "@lib/validations * type: integer * required: true * description: Numeric ID of the user to get - * security: - * - ApiKeyAuth: [] + * tags: * - users * responses: @@ -35,28 +34,20 @@ import { schemaUserEditBodyParams, schemaUserReadPublic } from "@lib/validations * description: User was not found * patch: * summary: Edit an existing user - * consumes: - * - application/json + * parameters: - * - in: body - * name: name - * description: The users full name - * schema: - * type: string * - in: path * name: id * schema: * type: integer * required: true * description: Numeric ID of the user to edit - * security: - * - ApiKeyAuth: [] + * tags: * - users * responses: * 201: * description: OK, user edited successfuly - * model: User * 400: * description: Bad request. User body is invalid. * 401: @@ -70,14 +61,12 @@ import { schemaUserEditBodyParams, schemaUserReadPublic } from "@lib/validations * type: integer * required: true * description: Numeric ID of the user to delete - * security: - * - ApiKeyAuth: [] + * tags: * - users * responses: * 201: * description: OK, user removed successfuly - * model: User * 400: * description: Bad request. User id is invalid. * 401: diff --git a/pages/api/users/index.ts b/pages/api/users/index.ts index fa28b36f5e..c5dfd71b68 100644 --- a/pages/api/users/index.ts +++ b/pages/api/users/index.ts @@ -11,8 +11,7 @@ import { schemaUserReadPublic } from "@lib/validations/user"; * /users: * get: * summary: Find all users (admin only), returns your user if regular user. - * security: - * - ApiKeyAuth: [] + * tags: * - users * responses: diff --git a/templates/endpoints/[id]/delete.ts b/templates/endpoints/[id]/delete.ts index 9c5c6f9f7c..908e74b7d5 100644 --- a/templates/endpoints/[id]/delete.ts +++ b/templates/endpoints/[id]/delete.ts @@ -21,14 +21,12 @@ import { * type: integer * required: true * description: Numeric ID of the resource to delete - * security: - * - ApiKeyAuth: [] + * tags: * - resources * responses: * 201: * description: OK, resource removed successfuly - * model: Resource * 400: * description: Bad request. Resource id is invalid. * 401: diff --git a/templates/endpoints/[id]/edit.ts b/templates/endpoints/[id]/edit.ts index 8ddad4601d..43cb6c8f8e 100644 --- a/templates/endpoints/[id]/edit.ts +++ b/templates/endpoints/[id]/edit.ts @@ -22,14 +22,12 @@ import { * type: integer * required: true * description: Numeric ID of the resource to edit - * security: - * - ApiKeyAuth: [] + * tags: * - resources * responses: * 201: * description: OK, resource edited successfuly - * model: Resource * 400: * description: Bad request. Resource body is invalid. * 401: diff --git a/templates/endpoints/[id]/index.ts b/templates/endpoints/[id]/index.ts index 9f4c64f11d..c3297459ac 100644 --- a/templates/endpoints/[id]/index.ts +++ b/templates/endpoints/[id]/index.ts @@ -22,8 +22,7 @@ import { * type: integer * required: true * description: Numeric ID of the resource to get - * security: - * - ApiKeyAuth: [] + * tags: * - resources * responses: diff --git a/templates/endpoints/get_all.ts b/templates/endpoints/get_all.ts index ee66e7c773..e925133346 100644 --- a/templates/endpoints/get_all.ts +++ b/templates/endpoints/get_all.ts @@ -11,8 +11,7 @@ import { schemaResourcePublic } from "@lib/validations/resource"; * /v1/resources: * get: * summary: Find all resources - * security: - * - ApiKeyAuth: [] + * tags: * - resources * responses: diff --git a/templates/endpoints/get_all_and_post.ts b/templates/endpoints/get_all_and_post.ts index 2ce4b8dfe9..d20075e52c 100644 --- a/templates/endpoints/get_all_and_post.ts +++ b/templates/endpoints/get_all_and_post.ts @@ -11,8 +11,7 @@ import { schemaPaymentBodyParams, schemaPaymentPublic } from "@lib/validations/p * /v1/payments: * get: * summary: Find all payments - * security: - * - ApiKeyAuth: [] + * tags: * - payments * responses: @@ -24,14 +23,12 @@ import { schemaPaymentBodyParams, schemaPaymentPublic } from "@lib/validations/p * description: No payments were found * post: * summary: Creates a new payment - * security: - * - ApiKeyAuth: [] + * tags: * - payments * responses: * 201: * description: OK, payment created - * model: Payment * 400: * description: Bad request. Payment body is invalid. * 401: diff --git a/templates/endpoints/post.ts b/templates/endpoints/post.ts index 999bce39c1..3f5b7403d7 100644 --- a/templates/endpoints/post.ts +++ b/templates/endpoints/post.ts @@ -18,14 +18,12 @@ import { schemaResourceBodyParams, schemaResourcePublic, withValidResource } fro * application/json: * schema: * $ref: '#/components/schemas/Resource' - * security: - * - ApiKeyAuth: [] + * tags: * - resources * responses: * 201: * description: OK, resource created - * model: Resource * 400: * description: Bad request. Resource body is invalid. * 401: