docs: Add full Swagger JSDoc coverage

This commit is contained in:
Maksim Eltyshev
2025-09-08 16:20:27 +02:00
parent e6b4c33542
commit 5ad3134519
128 changed files with 7610 additions and 0 deletions

View File

@@ -3,6 +3,66 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* @swagger
* /api/base-custom-field-groups/{baseCustomFieldGroupId}/custom-fields:
* post:
* summary: Create custom field in base custom field group
* description: Creates a custom field within a base custom field group. Requires project manager permissions.
* tags:
* - Custom Fields
* parameters:
* - name: baseCustomFieldGroupId
* in: path
* required: true
* description: ID of the base custom field group to create the custom field in
* schema:
* type: string
* example: 1357158568008091264
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* required:
* - position
* - name
* properties:
* position:
* type: number
* minimum: 0
* description: Position of the custom field within the group
* example: 65536
* name:
* type: string
* maxLength: 128
* description: Name/title of the custom field
* example: Priority
* showOnFrontOfCard:
* type: boolean
* description: Whether to show the field on the front of cards
* example: true
* responses:
* 200:
* description: Custom field created successfully
* content:
* application/json:
* schema:
* type: object
* required:
* - item
* properties:
* item:
* $ref: '#/components/schemas/CustomField'
* 400:
* $ref: '#/components/responses/ValidationError'
* 401:
* $ref: '#/components/responses/Unauthorized'
* 404:
* $ref: '#/components/responses/NotFound'
*/
const { idInput } = require('../../../utils/inputs');
const Errors = {

View File

@@ -3,6 +3,68 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* @swagger
* /api/custom-field-groups/{customFieldGroupId}/custom-fields:
* post:
* summary: Create custom field in custom field group
* description: Creates a custom field within a custom field group. Requires board editor permissions.
* tags:
* - Custom Fields
* parameters:
* - name: customFieldGroupId
* in: path
* required: true
* description: ID of the custom field group to create the custom field in
* schema:
* type: string
* example: 1357158568008091264
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* required:
* - position
* - name
* properties:
* position:
* type: number
* minimum: 0
* description: Position of the custom field within the group
* example: 65536
* name:
* type: string
* maxLength: 128
* description: Name/title of the custom field
* example: Priority
* showOnFrontOfCard:
* type: boolean
* description: Whether to show the field on the front of cards
* example: true
* responses:
* 200:
* description: Custom field created successfully
* content:
* application/json:
* schema:
* type: object
* required:
* - item
* properties:
* item:
* $ref: '#/components/schemas/CustomField'
* 400:
* $ref: '#/components/responses/ValidationError'
* 401:
* $ref: '#/components/responses/Unauthorized'
* 403:
* $ref: '#/components/responses/Forbidden'
* 404:
* $ref: '#/components/responses/NotFound'
*/
const { idInput } = require('../../../utils/inputs');
const Errors = {

View File

@@ -3,6 +3,44 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* @swagger
* /api/custom-fields/{id}:
* delete:
* summary: Delete custom field
* description: Deletes a custom field. Can delete the in base custom field group (requires project manager permissions) or the custom field group (requires board editor permissions).
* tags:
* - Custom Fields
* parameters:
* - name: id
* in: path
* required: true
* description: ID of the custom field to delete
* schema:
* type: string
* example: 1357158568008091264
* responses:
* 200:
* description: Custom field deleted successfully
* content:
* application/json:
* schema:
* type: object
* required:
* - item
* properties:
* item:
* $ref: '#/components/schemas/CustomField'
* 400:
* $ref: '#/components/responses/ValidationError'
* 401:
* $ref: '#/components/responses/Unauthorized'
* 403:
* $ref: '#/components/responses/Forbidden'
* 404:
* $ref: '#/components/responses/NotFound'
*/
const { idInput } = require('../../../utils/inputs');
const Errors = {

View File

@@ -3,6 +3,65 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* @swagger
* /api/custom-fields/{id}:
* patch:
* summary: Update custom field
* description: Updates a custom field. Can update in the base custom field group (requires project manager permissions) or the custom field group (requires board editor permissions).
* tags:
* - Custom Fields
* parameters:
* - name: id
* in: path
* required: true
* description: ID of the custom field to update
* schema:
* type: string
* example: 1357158568008091264
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* position:
* type: number
* minimum: 0
* description: Position of the custom field within the group
* example: 65536
* name:
* type: string
* maxLength: 128
* description: Name/title of the custom field
* example: Priority
* showOnFrontOfCard:
* type: boolean
* description: Whether to show the field on the front of cards
* example: false
* responses:
* 200:
* description: Custom field updated successfully
* content:
* application/json:
* schema:
* type: object
* required:
* - item
* properties:
* item:
* $ref: '#/components/schemas/CustomField'
* 400:
* $ref: '#/components/responses/ValidationError'
* 401:
* $ref: '#/components/responses/Unauthorized'
* 403:
* $ref: '#/components/responses/Forbidden'
* 404:
* $ref: '#/components/responses/NotFound'
*/
const { idInput } = require('../../../utils/inputs');
const Errors = {