Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.6 kB
1
Indexable
Never
openapi: 3.0.0
info:
  title: API de Gestión de Tareas
  version: 1.0.0
  description: API para asignar tareas a usuarios.

paths:
  /tasks/take:
    post:
      summary: Asignar tarea a usuario
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignTaskInput'
      responses:
        '200':
          description: Tarea asignada correctamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '404':
          description: Tarea o usuario no encontrados
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error en el servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

components:
  schemas:
    AssignTaskInput:
      type: object
      properties:
        taskId:
          type: string
          description: ID de la tarea a asignar
        userId:
          type: string
          description: ID del usuario al que se asignará la tarea
      required:
        - taskId
        - userId

    SuccessResponse:
      type: object
      properties:
        message:
          type: string
          description: Mensaje indicando que la tarea se asignó correctamente

    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Mensaje de error
Leave a Comment