Подсказки
Фрагмент вставляется в текущее положение курсора.
Автодополнение: само при наборе, Ctrl+Space или Ctrl+I. На Mac обе вызываются клавишей Control. Дальше стрелки и Enter.
Путь
Ключ пути начинается со слэша. Методы — get, post, put, patch, delete.
GET с параметром пути
/orders/{id}:
get:
summary: Заказ
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
"200":
description: ЗаказПараметр
in: query, path, header или cookie. У path-параметра required: true.
Query-параметр
- name: status
in: query
description: Фильтр по статусу
schema:
type: stringТело запроса
JSON-тело
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Order"Ответ
Ответ 201
"201":
description: Создано
content:
application/json:
schema:
$ref: "#/components/schemas/Order"Ответ 4xx
"400":
description: Некорректный запрос
Схема
Объект
Order:
type: object
required:
- id
properties:
id:
type: stringSecurity
Bearer-токен
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
security:
- bearerAuth: []