Update availabilities _post swagger def (#210)

- Adds more specs to the swagger definition in /availabilities for doc
experimentation
pull/9078/head
Syed Ali Shahbaz 2022-11-19 00:48:07 +05:30 committed by GitHub
parent e5827b035d
commit 4080e5bc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 14 deletions

View File

@ -17,6 +17,12 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
* type: integer
* required: true
* description: ID of the availability to delete
* - in: query
* name: apiKey
* required: true
* schema:
* type: integer
* description: Your API key
* tags:
* - availabilities
* externalDocs:

View File

@ -18,6 +18,12 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
* type: integer
* required: true
* description: ID of the availability to get
* - in: query
* name: apiKey
* required: true
* schema:
* type: integer
* description: Your API key
* tags:
* - availabilities
* externalDocs:
@ -26,7 +32,9 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
* 200:
* description: OK
* 401:
* description: Unauthorized
* description: Authorization information is missing or invalid
* 404:
* description: Availability not found
*/
export async function getHandler(req: NextApiRequest) {
const { prisma, query } = req;

View File

@ -14,6 +14,19 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
* patch:
* operationId: editAvailabilityById
* summary: Edit an existing availability
* parameters:
* - in: query
* name: apiKey
* required: true
* description: Your API key
* schema:
* type: integer
* - in: path
* name: id
* required: true
* schema:
* type: integer
* description: ID of the availability to edit
* requestBody:
* description: Edit an existing availability related to one of your bookings
* required: true
@ -24,20 +37,28 @@ import { schemaQueryIdParseInt } from "@lib/validations/shared/queryIdTransformP
* properties:
* days:
* type: array
* example: email@example.com
* description: Array of integers depicting weekdays
* items:
* type: integer
* enum: [0, 1, 2, 3, 4, 5]
* scheduleId:
* type: integer
* description: ID of schedule this availability is associated with
* startTime:
* type: string
* example: 1970-01-01T17:00:00.000Z
* description: Start time of the availability
* endTime:
* type: string
* example: 1970-01-01T17:00:00.000Z
* parameters:
* - in: path
* name: id
* schema:
* type: integer
* required: true
* description: ID of the availability to edit
* description: End time of the availability
* examples:
* availability:
* summary: An example of availability
* value:
* scheduleId: 123
* days: [1,2,3,5]
* startTime: 1970-01-01T17:00:00.000Z
* endTime: 1970-01-01T17:00:00.000Z
*
* tags:
* - availabilities
* externalDocs:

View File

@ -14,6 +14,13 @@ import {
* post:
* operationId: addAvailability
* summary: Creates a new availability
* parameters:
* - in: query
* name: apiKey
* requiried: true
* description: Your API key
* schema:
* type: integer
* requestBody:
* description: Edit an existing availability related to one of your bookings
* required: true
@ -28,13 +35,29 @@ import {
* properties:
* days:
* type: array
* example: email@example.com
* description: Array of integers depicting weekdays
* items:
* type: integer
* enum: [0, 1, 2, 3, 4, 5]
* scheduleId:
* type: integer
* description: ID of schedule this availability is associated with
* startTime:
* type: string
* example: 1970-01-01T17:00:00.000Z
* description: Start time of the availability
* endTime:
* type: string
* example: 1970-01-01T17:00:00.000Z
* description: End time of the availability
* examples:
* availability:
* summary: An example of availability
* value:
* scheduleId: 123
* days: [1,2,3,5]
* startTime: 1970-01-01T17:00:00.000Z
* endTime: 1970-01-01T17:00:00.000Z
*
*
* tags:
* - availabilities
* externalDocs: