Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- title: 'Tasks API'
- version: '0.1'
- paths:
- /api/v1/tasks:
- post:
- tags:
- - tasks
- summary: 'Создание задачи'
- parameters:
- - in: body
- name: body
- required: true
- schema:
- $ref: "#/definitions/Task"
- responses:
- '200':
- description: 'Задача успешно создана'
- schema:
- type: object
- allOf:
- - { $ref: '#/definitions/ApiResult' }
- - { properties: { success: { type: boolean, example: true } } }
- '422':
- description: 'Отсутствует тело запроса'
- schema:
- type: object
- allOf:
- - { $ref: '#/definitions/ApiResult' }
- - { properties: { success: { type: boolean, example: false } } }
- definitions:
- ApiResult:
- description: 'Стандартизированный ответ API'
- properties:
- data:
- description: Данные
- type: object
- meta:
- description: 'Разная опциональная дополнительная информация'
- properties:
- processing_time:
- description: 'Суммарное время обработки запроса'
- type: number
- format: float
- example: 0.8377
- type: object
- errors:
- description: 'Список ошибок'
- type: object
- success:
- description: 'Результат выполнения запроса (true - нет ошибки, false - ошибка)'
- type: boolean
- example: true
- type: object
- Task:
- description: 'Задача'
- properties:
- headline:
- type: string
- example: 'Починить компьютер'
- description:
- type: string
- example: 'Заменить блок питания, увеличить объём оперативной памяти'
- created_at:
- description: 'Дата и время завершения'
- type: string
- format: datetime
- example: '2020-09-29T20:47:52Z'
- type: object
- tags:
- -
- name: tasks
- description: Задачи
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement