mirror of
https://github.com/plankanban/planka.git
synced 2025-12-20 01:14:12 +03:00
docs: Add full Swagger JSDoc coverage
This commit is contained in:
@@ -3,6 +3,106 @@
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/lists/{listId}/cards:
|
||||
* post:
|
||||
* summary: Create card
|
||||
* description: Creates a card within a list. Requires board editor permissions.
|
||||
* tags:
|
||||
* - Cards
|
||||
* parameters:
|
||||
* - name: listId
|
||||
* in: path
|
||||
* required: true
|
||||
* description: ID of the list to create the card in
|
||||
* schema:
|
||||
* type: string
|
||||
* example: 1357158568008091264
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - type
|
||||
* - name
|
||||
* properties:
|
||||
* type:
|
||||
* type: string
|
||||
* enum: [project, story]
|
||||
* description: Type of the card
|
||||
* example: project
|
||||
* position:
|
||||
* type: number
|
||||
* minimum: 0
|
||||
* nullable: true
|
||||
* description: Position of the card within the list
|
||||
* example: 65536
|
||||
* name:
|
||||
* type: string
|
||||
* maxLength: 1024
|
||||
* description: Name/title of the card
|
||||
* example: Implement user authentication
|
||||
* description:
|
||||
* type: string
|
||||
* maxLength: 1048576
|
||||
* nullable: true
|
||||
* description: Detailed description of the card
|
||||
* example: Add JWT-based authentication system...
|
||||
* dueDate:
|
||||
* type: string
|
||||
* format: date-time
|
||||
* nullable: true
|
||||
* description: Due date for the card
|
||||
* example: 2024-01-01T00:00:00.000Z
|
||||
* isDueCompleted:
|
||||
* type: boolean
|
||||
* nullable: true
|
||||
* description: Whether the due date is completed
|
||||
* example: false
|
||||
* stopwatch:
|
||||
* type: object
|
||||
* required:
|
||||
* - startedAt
|
||||
* - total
|
||||
* nullable: true
|
||||
* description: Stopwatch data for time tracking
|
||||
* properties:
|
||||
* startedAt:
|
||||
* type: string
|
||||
* format: date-time
|
||||
* description: When the stopwatch was started
|
||||
* example: 2024-01-01T00:00:00.000Z
|
||||
* total:
|
||||
* type: number
|
||||
* description: Total time in seconds
|
||||
* example: 3600
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Card created successfully
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - item
|
||||
* properties:
|
||||
* item:
|
||||
* $ref: '#/components/schemas/Card'
|
||||
* 400:
|
||||
* $ref: '#/components/responses/ValidationError'
|
||||
* 401:
|
||||
* $ref: '#/components/responses/Unauthorized'
|
||||
* 403:
|
||||
* $ref: '#/components/responses/Forbidden'
|
||||
* 404:
|
||||
* $ref: '#/components/responses/NotFound'
|
||||
* 422:
|
||||
* $ref: '#/components/responses/UnprocessableEntity'
|
||||
*/
|
||||
|
||||
const { isDueDate, isStopwatch } = require('../../../utils/validators');
|
||||
const { idInput } = require('../../../utils/inputs');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user