Skip to content

Scheduling infrastructure for absolutely everyone.

Adds more definition to USER swagger (#212)

Syed Ali Shahbazbbaa8ae5e7fd
diff --git a/pages/api/users/[userId]/_delete.ts b/pages/api/users/[userId]/_delete.ts
index 46ab08e5f91..f089e64d62a 100644
--- a/pages/api/users/[userId]/_delete.ts
+++ b/pages/api/users/[userId]/_delete.ts
@@ -7,18 +7,24 @@ import { schemaQueryUserId } from "@lib/validations/shared/queryUserId";
/**
* @swagger
- * /users/{id}:
+ * /users/{userId}:
* delete:
* summary: Remove an existing user
* operationId: removeUserById
* parameters:
* - in: path
- * name: id
+ * name: userId
* example: 1
* schema:
* type: integer
* required: true
* description: ID of the user to delete
+ * - in: query
+ * name: apiKey
+ * schema:
+ * type: string
+ * required: true
+ * description: Your API key
* tags:
* - users
* responses:
diff --git a/pages/api/users/[userId]/_get.ts b/pages/api/users/[userId]/_get.ts
index 360103560be..598fe3be8e4 100644
--- a/pages/api/users/[userId]/_get.ts
+++ b/pages/api/users/[userId]/_get.ts
@@ -8,18 +8,24 @@ import { schemaUserReadPublic } from "@lib/validations/user";
/**
* @swagger
- * /users/{id}:
+ * /users/{userId}:
* get:
* summary: Find a user, returns your user if regular user.
* operationId: getUserById
* parameters:
* - in: path
- * name: id
+ * name: userId
* example: 4
* schema:
* type: integer
* required: true
* description: ID of the user to get
+ * - in: query
+ * name: apiKey
+ * schema:
+ * type: string
+ * required: true
+ * description: Your API key
* tags:
* - users
* responses:
diff --git a/pages/api/users/[userId]/_patch.ts b/pages/api/users/[userId]/_patch.ts
index 3f7761c5391..4204cf78236 100644
--- a/pages/api/users/[userId]/_patch.ts
+++ b/pages/api/users/[userId]/_patch.ts
@@ -8,10 +8,24 @@ import { schemaUserEditBodyParams, schemaUserReadPublic } from "@lib/validations
/**
* @swagger
- * /users/{id}:
+ * /users/{userId}:
* patch:
* summary: Edit an existing user
* operationId: editUserById
+ * parameters:
+ * - in: path
+ * name: userId
+ * example: 4
+ * schema:
+ * type: integer
+ * required: true
+ * description: ID of the user to edit
+ * - in: query
+ * name: apiKey
+ * required: true
+ * schema:
+ * type: string
+ * description: Your API key
* requestBody:
* description: Edit an existing attendee related to one of your bookings
* required: true
@@ -20,27 +34,47 @@ import { schemaUserEditBodyParams, schemaUserReadPublic } from "@lib/validations
* schema:
* type: object
* properties:
- * weekStart:
+ * email:
+ * type: string
+ * format: email
+ * description: Email that belongs to the user being edited
+ * username:
* type: string
- * enum: [Monday, Sunday, Saturday]
- * example: Monday
+ * description: Username for the user being edited
* brandColor:
+ * description: The user's brand color
* type: string
- * example: "#FF000F"
* darkBrandColor:
+ * description: The user's brand color for dark mode
* type: string
- * example: "#000000"
- * timeZone:
+ * weekStart:
+ * description: Start of the week. Acceptable values are one of [SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY]
* type: string
- * example: Europe/London
- * parameters:
- * - in: path
- * name: id
- * example: 4
- * schema:
- * type: integer
- * required: true
- * description: ID of the user to edit
+ * timeZone:
+ * description: The user's time zone
+ * type: string
+ * theme:
+ * description: Default theme for the user. Acceptable values are one of [DARK, LIGHT]
+ * type: string
+ * timeFormat:
+ * description: The user's time format. Acceptable values are one of [TWELVE, TWENTY_FOUR]
+ * type: string
+ * locale:
+ * description: The user's locale. Acceptable values are one of [EN, FR, IT, RU, ES, DE, PT, RO, NL, PT_BR, ES_419, KO, JA, PL, AR, IW, ZH_CH, ZH_TW, CS, SR, SV, VI]
+ * type: string
+ * examples:
+ * user:
+ * summary: An example of USER
+ * value:
+ * username: johndoe
+ * weekStart: MONDAY
+ * brandColor: #555555
+ * darkBrandColor: #111111
+ * timeZone: EUROPE/PARIS
+ * theme: LIGHT
+ * timeFormat: TWELVE
+ * locale: FR
* tags:
* - users
* responses:
diff --git a/pages/api/users/_get.ts b/pages/api/users/_get.ts
index 853eef938b9..12638a0b396 100644
--- a/pages/api/users/_get.ts
+++ b/pages/api/users/_get.ts
@@ -13,6 +13,13 @@ import { Prisma } from ".prisma/client";
* get:
* operationId: listUsers
* summary: Find all users.
+ * parameters:
+ * - in: query
+ * name: apiKey
+ * required: true
+ * schema:
+ * type: string
+ * description: Your API key
* tags:
* - users
* responses:
diff --git a/pages/api/users/_post.ts b/pages/api/users/_post.ts
index a8eff743dd6..d69f7da43a0 100644
--- a/pages/api/users/_post.ts
+++ b/pages/api/users/_post.ts
@@ -11,6 +11,65 @@ import { schemaUserCreateBodyParams } from "@lib/validations/user";
* post:
* operationId: addUser
* summary: Creates a new user
+ * parameters:
+ * - in: query
+ * name: apiKey
+ * required: true
+ * schema:
+ * type: string
+ * description: Your API key
+ * requestBody:
+ * description: Create a new user
+ * required: true
+ * content:
+ * application/json:
+ * schema:
+ * type: object
+ * required:
+ * - email
+ * - username
+ * properties:
+ * email:
+ * type: string
+ * format: email
+ * description: Email that belongs to the user being edited
+ * username:
+ * type: string
+ * description: Username for the user being created
+ * brandColor:
+ * description: The new user's brand color
+ * type: string
+ * darkBrandColor:
+ * description: The new user's brand color for dark mode
+ * type: string
+ * weekStart:
+ * description: Start of the week. Acceptable values are one of [SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY]
+ * type: string
+ * timeZone:
+ * description: The new user's time zone
+ * type: string
+ * theme:
+ * description: Default theme for the new user. Acceptable values are one of [DARK, LIGHT]
+ * type: string
+ * timeFormat:
+ * description: The new user's time format. Acceptable values are one of [TWELVE, TWENTY_FOUR]
+ * type: string
+ * locale:
+ * description: The new user's locale. Acceptable values are one of [EN, FR, IT, RU, ES, DE, PT, RO, NL, PT_BR, ES_419, KO, JA, PL, AR, IW, ZH_CH, ZH_TW, CS, SR, SV, VI]
+ * type: string
+ * examples:
+ * user:
+ * summary: An example of USER
+ * value:
+ * username: johndoe
+ * weekStart: MONDAY
+ * brandColor: #555555
+ * darkBrandColor: #111111
+ * timeZone: EUROPE/PARIS
+ * theme: LIGHT
+ * timeFormat: TWELVE
+ * locale: FR
* tags:
* - users
* responses: