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,178 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* @swagger
* /api/projects/{projectId}/boards:
* post:
* summary: Create board
* description: Creates a board within a project. Supports importing from Trello. Requires project manager permissions.
* tags:
* - Boards
* parameters:
* - name: projectId
* in: path
* required: true
* description: ID of the project to create the board 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 board within the project
* example: 65536
* name:
* type: string
* maxLength: 128
* description: Name/title of the board
* example: Development Board
* defaultView:
* type: string
* enum: [kanban, grid, list]
* default: kanban
* description: Default view for the board
* example: kanban
* defaultCardType:
* type: string
* enum: [project, story]
* default: project
* description: Default card type for new cards
* example: project
* limitCardTypesToDefaultOne:
* type: boolean
* default: false
* description: Whether to limit card types to default one
* example: false
* alwaysDisplayCardCreator:
* type: boolean
* default: false
* description: Whether to always display the card creator
* example: false
* expandTaskListsByDefault:
* type: boolean
* default: false
* description: Whether to expand task lists by default
* example: false
* multipart/form-data:
* schema:
* type: object
* required:
* - position
* - name
* properties:
* position:
* type: number
* minimum: 0
* description: Position of the board within the project
* example: 65536
* name:
* type: string
* maxLength: 128
* description: Name/title of the board
* example: Development Board
* defaultView:
* type: string
* enum: [kanban, grid, list]
* default: kanban
* description: Default view for the board
* example: kanban
* defaultCardType:
* type: string
* enum: [project, story]
* default: project
* description: Default card type for new cards
* example: project
* limitCardTypesToDefaultOne:
* type: boolean
* default: false
* description: Whether to limit card types to default one
* example: false
* alwaysDisplayCardCreator:
* type: boolean
* default: false
* description: Whether to always display the card creator
* example: false
* expandTaskListsByDefault:
* type: boolean
* default: false
* description: Whether to expand task lists by default
* example: false
* importType:
* type: string
* enum: [trello]
* description: Type of import
* example: trello
* importFile:
* type: string
* format: binary
* description: Import file
* requestId:
* type: string
* maxLength: 128
* description: Request ID for tracking
* example: req_123456
* responses:
* 200:
* description: Board created successfully
* content:
* application/json:
* schema:
* type: object
* required:
* - item
* - included
* properties:
* item:
* $ref: '#/components/schemas/Board'
* included:
* type: object
* required:
* - boardMemberships
* properties:
* boardMemberships:
* type: array
* items:
* $ref: '#/components/schemas/BoardMembership'
* 400:
* $ref: '#/components/responses/ValidationError'
* 401:
* $ref: '#/components/responses/Unauthorized'
* 404:
* $ref: '#/components/responses/NotFound'
* 422:
* description: Import file upload error
* content:
* application/json:
* schema:
* type: object
* required:
* - code
* - message
* properties:
* code:
* type: string
* description: Error code
* example: E_UNPROCESSABLE_ENTITY
* message:
* type: string
* enum:
* - No import file was uploaded
* - Invalid import file
* description: Specific error message
* example: No import file was uploaded
*/
const { idInput } = require('../../../utils/inputs');
const Errors = {