Improves custom inputs docs in swagger (#233)

Adds swagger definition to `custom-inputs` endpoint
This commit is contained in:
Syed Ali Shahbaz
2023-02-08 14:38:04 -07:00
committed by GitHub
parent dc0a6eaa32
commit f170f17f2c
5 changed files with 125 additions and 0 deletions
+6
View File
@@ -16,6 +16,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
* type: integer
* required: true
* description: ID of the eventTypeCustomInput to delete
* - in: query
* name: apiKey
* required: true
* schema:
* type: string
* description: Your API key
* tags:
* - custom-inputs
* responses:
+6
View File
@@ -17,6 +17,12 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
* type: integer
* required: true
* description: ID of the eventTypeCustomInput to get
* - in: query
* name: apiKey
* required: true
* schema:
* type: string
* description: Your API key
* tags:
* - custom-inputs
* responses:
+45
View File
@@ -13,6 +13,44 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
* /custom-inputs/{id}:
* patch:
* summary: Edit an existing eventTypeCustomInput
* requestBody:
* description: Edit an existing eventTypeCustomInput for an event type
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* eventTypeId:
* type: integer
* description: 'ID of the event type to which the custom input is being added'
* label:
* type: string
* description: 'Label of the custom input'
* type:
* type: string
* description: 'Type of the custom input. The value is ENUM; one of [TEXT, TEXTLONG, NUMBER, BOOL, RADIO, PHONE]'
* options:
* type: object
* properties:
* label:
* type: string
* type:
* type: string
* description: 'Options for the custom input'
* required:
* type: boolean
* description: 'If the custom input is required before booking'
* placeholder:
* type: string
* description: 'Placeholder text for the custom input'
*
* examples:
* custom-inputs:
* summary: Example of patching an existing Custom Input
* value:
* required: true
*
* parameters:
* - in: path
* name: id
@@ -20,6 +58,13 @@ import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransform
* type: integer
* required: true
* description: ID of the eventTypeCustomInput to edit
* - in: query
* name: apiKey
* required: true
* schema:
* type: string
* description: Your API key
*
* tags:
* - custom-inputs
* responses:
+7
View File
@@ -10,6 +10,13 @@ import { schemaEventTypeCustomInputPublic } from "~/lib/validations/event-type-c
* /custom-inputs:
* get:
* summary: Find all eventTypeCustomInputs
* parameters:
* - in: query
* name: apiKey
* required: true
* schema:
* type: string
* description: Your API key
* tags:
* - custom-inputs
* responses:
+61
View File
@@ -8,11 +8,72 @@ import {
schemaEventTypeCustomInputPublic,
} from "~/lib/validations/event-type-custom-input";
// id: z.number().int(),
// eventTypeId: z.number().int(),
// label: z.string(),
// type: z.nativeEnum(EventTypeCustomInputType),
// required: z.boolean(),
// placeholder: z.string(),
/**
* @swagger
* /custom-inputs:
* post:
* summary: Creates a new eventTypeCustomInput
* parameters:
* - in: query
* name: apiKey
* required: true
* schema:
* type: string
* description: Your API key
* requestBody:
* description: Create a new custom input for an event type
* required: true
* content:
* application/json:
* schema:
* type: object
* required:
* - eventTypeId
* - label
* - type
* - required
* - placeholder
* properties:
* eventTypeId:
* type: integer
* description: 'ID of the event type to which the custom input is being added'
* label:
* type: string
* description: 'Label of the custom input'
* type:
* type: string
* description: 'Type of the custom input. The value is ENUM; one of [TEXT, TEXTLONG, NUMBER, BOOL, RADIO, PHONE]'
* options:
* type: object
* properties:
* label:
* type: string
* type:
* type: string
* description: 'Options for the custom input'
* required:
* type: boolean
* description: 'If the custom input is required before booking'
* placeholder:
* type: string
* description: 'Placeholder text for the custom input'
*
* examples:
* custom-inputs:
* summary: An example of custom-inputs
* value:
* eventTypeID: 1
* label: "Phone Number"
* type: "PHONE"
* required: true
* placeholder: "100 101 1234"
*
* tags:
* - custom-inputs
* responses: