Adds more definition to USER swagger (#212)

Adds more definition for documentation for the USER endpoints
This commit is contained in:
Syed Ali Shahbaz
2022-11-18 12:20:15 -07:00
committed by GitHub
parent 3654677a20
commit bbaa8ae5e7
5 changed files with 132 additions and 20 deletions
+8 -2
View File
@@ -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:
+8 -2
View File
@@ -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:
+50 -16
View File
@@ -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
* enum: [Monday, Sunday, Saturday]
* example: Monday
* format: email
* description: Email that belongs to the user being edited
* username:
* type: string
* 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:
* email: email@example.com
* username: johndoe
* weekStart: MONDAY
* brandColor: #555555
* darkBrandColor: #111111
* timeZone: EUROPE/PARIS
* theme: LIGHT
* timeFormat: TWELVE
* locale: FR
* tags:
* - users
* responses:
+7
View File
@@ -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:
+59
View File
@@ -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:
* email: email@example.com
* username: johndoe
* weekStart: MONDAY
* brandColor: #555555
* darkBrandColor: #111111
* timeZone: EUROPE/PARIS
* theme: LIGHT
* timeFormat: TWELVE
* locale: FR
* tags:
* - users
* responses: