Advertisement
dimuska139

Untitled

Jan 6th, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.29 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3.   title: 'Tasks API'
  4.   version: '0.1'
  5. paths:
  6.   /api/v1/tasks:
  7.     post:
  8.       tags:
  9.        - tasks
  10.       summary: 'Создание задачи'
  11.       parameters:
  12.         - in: body
  13.           name: body
  14.           required: true
  15.           schema:
  16.             $ref: "#/definitions/Task"
  17.       responses:
  18.         '200':
  19.           description: 'Задача успешно создана'
  20.           schema:
  21.             type: object
  22.             allOf:
  23.               - { $ref: '#/definitions/ApiResult' }
  24.               - { properties: { success: { type: boolean, example: true } } }
  25.         '422':
  26.           description: 'Отсутствует тело запроса'
  27.           schema:
  28.             type: object
  29.             allOf:
  30.               - { $ref: '#/definitions/ApiResult' }
  31.               - { properties: { success: { type: boolean, example: false } } }
  32. definitions:
  33.   ApiResult:
  34.     description: 'Стандартизированный ответ API'
  35.     properties:
  36.       data:
  37.         description: Данные
  38.         type: object
  39.       meta:
  40.         description: 'Разная опциональная дополнительная информация'
  41.         properties:
  42.           processing_time:
  43.             description: 'Суммарное время обработки запроса'
  44.             type: number
  45.             format: float
  46.             example: 0.8377
  47.         type: object
  48.       errors:
  49.         description: 'Список ошибок'
  50.         type: object
  51.       success:
  52.         description: 'Результат выполнения запроса (true - нет ошибки, false - ошибка)'
  53.         type: boolean
  54.         example: true
  55.     type: object
  56.   Task:
  57.     description: 'Задача'
  58.     properties:
  59.       headline:
  60.         type: string
  61.         example: 'Починить компьютер'
  62.       description:
  63.         type: string
  64.         example: 'Заменить блок питания, увеличить объём оперативной памяти'
  65.       created_at:
  66.         description: 'Дата и время завершения'
  67.         type: string
  68.         format: datetime
  69.         example: '2020-09-29T20:47:52Z'
  70.     type: object
  71. tags:
  72.  -
  73.     name: tasks
  74.     description: Задачи
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement