{ "openapi": "3.1.0", "info": { "title": "Fastfood-API", "description": "\n# 🔥🔥🔥Fastfood-API поможет тебе подкрепиться 🔥🔥🔥\n\n### У нас есть Menu. Ты можеш выбрать блюда из кухни, которая тебе нравится\n\n## Menu\n\nТы можешь **add menu**.\n\nТы можешь **read menu**.\n\nТы можешь **patch menu**.\n\nТы можешь **delete menu**.\n\n### У нас есть в SubMenu, где ты сможешь найти\nдесерты/напитки/супчики/прочие вкусности\n\n# SubMenu\n\nТы можешь **add submenu into menu**.\n\nТы можешь **read submenu**.\n\nТы можешь **patch submenu**.\n\nТы можешь **delete menu**.\n\n### У нас есть в Dish, где ты сможешь найти блюдо по вкусу\n\n# Dish\n\nТы можешь **add dish into submenu**.\n\nТы можешь **read dish**.\n\nТы можешь **patch dish**.\n\nТы можешь **delete dish**.\n\n# Summary\n\nМожеш посмотреть все меню целиком\n\n## Приятного аппетита\n", "contact": { "name": "Sergey Vanyushkin", "url": "http://pi3c.ru/", "email": "pi3c@yandex.ru" }, "license": { "name": "MIT license", "url": "https://mit-license.org/" }, "version": "0.0.3" }, "paths": { "/api/v1/menus/": { "get": { "tags": [ "menu" ], "summary": "Получить список меню", "description": "Этот метод позволяет получить все меню.", "operationId": "get_menus_api_v1_menus__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/MenuRead" }, "type": "array", "title": "Response Get Menus Api V1 Menus Get" } } } } } }, "post": { "tags": [ "menu" ], "summary": "Создать меню", "description": "Этот метод позволяет создать меню", "operationId": "add_menu_api_v1_menus__post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuBase" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuRead" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/menus/{menu_id}": { "get": { "tags": [ "menu" ], "summary": "Получить меню", "description": "Этот метод позволяет получить меню по его UUID", "operationId": "get_menu_api_v1_menus__menu_id__get", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuRead" } } } }, "404": { "description": "Menu not found", "content": { "application/json": { "example": { "detail": "sting" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "menu" ], "summary": "Обновить меню", "description": "Этот метод позволяет изменить меню по его UUID", "operationId": "update_menu_api_v1_menus__menu_id__patch", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuBase" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuRead" } } } }, "404": { "description": "Menu not found", "content": { "application/json": { "example": { "detail": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "menu" ], "summary": "Удалить меню", "description": "Этот метод позволяет удалить меню по его UUID", "operationId": "delete_menu_api_v1_menus__menu_id__delete", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/menus/{menu_id}/submenus/": { "get": { "tags": [ "submenu" ], "summary": "Получить список подменю", "description": "Этот метод позволяет получить список подменю основного меню по UUID меню", "operationId": "get_submenus_api_v1_menus__menu_id__submenus__get", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SubMenuRead" }, "title": "Response Get Submenus Api V1 Menus Menu Id Submenus Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "submenu" ], "summary": "Создать подменю", "description": "Этот метод позволяет создать подменю по UUID родителского меню", "operationId": "create_submenu_item_api_v1_menus__menu_id__submenus__post", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuBase" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubMenuRead" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/menus/{menu_id}/submenus/{submenu_id}": { "get": { "tags": [ "submenu" ], "summary": "Получить подменю", "description": "Этот метод позволяет получить подменю по его UUID и UUID родительского меню", "operationId": "get_submenu_api_v1_menus__menu_id__submenus__submenu_id__get", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubMenuRead" } } } }, "404": { "description": "Submenu not found", "content": { "application/json": { "example": { "detail": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "submenu" ], "summary": "Обновить подменю", "description": "Этот метод позволяет обновить подменю по его UUID и UUID родительского меню", "operationId": "update_submenu_api_v1_menus__menu_id__submenus__submenu_id__patch", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuBase" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubMenuRead" } } } }, "404": { "description": "Submenu not found", "content": { "application/json": { "example": { "detail": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "submenu" ], "summary": "Удалить подменю", "description": "Этот метод позволяет удалить подменю по его UUID", "operationId": "delete_submenu_api_v1_menus__menu_id__submenus__submenu_id__delete", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/menus/{menu_id}/submenus/{submenu_id}/dishes/": { "get": { "tags": [ "dish" ], "summary": "Получить список блюд", "description": "Этот метод позволяет получить список всех блюда по UUID родительских меню и подменю", "operationId": "get_dishes_api_v1_menus__menu_id__submenus__submenu_id__dishes__get", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Dish" }, "title": "Response Get Dishes Api V1 Menus Menu Id Submenus Submenu Id Dishes Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "dish" ], "summary": "Создать блюдо", "description": "Этот метод позволяет создать блюдо по UUIDего родительских меню и подменю", "operationId": "create_dish_api_v1_menus__menu_id__submenus__submenu_id__dishes__post", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DishBase" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dish" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/menus/{menu_id}/submenus/{submenu_id}/dishes/{dish_id}": { "get": { "tags": [ "dish" ], "summary": "Получить блюдо", "description": "Этот метод позволяет получить блюдо по его UUID и UUID его родительских меню", "operationId": "get_dish_api_v1_menus__menu_id__submenus__submenu_id__dishes__dish_id__get", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } }, { "name": "dish_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Dish Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dish" } } } }, "404": { "description": "Dish not found", "content": { "application/json": { "example": { "detail": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "dish" ], "summary": "Обновить блюдо", "description": "Этот метод позволяет обновить блюдо по его UUID и UUID родительских меню", "operationId": "update_dish_api_v1_menus__menu_id__submenus__submenu_id__dishes__dish_id__patch", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } }, { "name": "dish_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Dish Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DishBase" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dish" } } } }, "404": { "description": "Dish not found", "content": { "application/json": { "example": { "detail": "string" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "dish" ], "summary": "Удалить блюдо", "description": "Этот метод позволяет удалить блюдо по его UUID и UUID родительских меню", "operationId": "delete_dish_api_v1_menus__menu_id__submenus__submenu_id__dishes__dish_id__delete", "parameters": [ { "name": "menu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Menu Id" } }, { "name": "submenu_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Submenu Id" } }, { "name": "dish_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Dish Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/summary/": { "get": { "tags": [ "summary" ], "summary": "Получить все меню", "description": "Этот метод позволяет получить полную структуру меню состоящую из меню, подменю и блюд", "operationId": "get_summary_api_v1_summary__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/MenuSummary" }, "type": "array", "title": "Response Get Summary Api V1 Summary Get" } } } } } } } }, "components": { "schemas": { "Dish": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "price": { "type": "string", "title": "Price" } }, "type": "object", "required": [ "title", "description", "id", "price" ], "title": "Dish" }, "DishBase": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "price": { "type": "string", "title": "Price" } }, "type": "object", "required": [ "title", "description", "price" ], "title": "DishBase" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "MenuBase": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" } }, "type": "object", "required": [ "title", "description" ], "title": "MenuBase" }, "MenuRead": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "submenus_count": { "type": "integer", "title": "Submenus Count" }, "dishes_count": { "type": "integer", "title": "Dishes Count" } }, "type": "object", "required": [ "title", "description", "id", "submenus_count", "dishes_count" ], "title": "MenuRead" }, "SubMenuRead": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "dishes_count": { "type": "integer", "title": "Dishes Count" } }, "type": "object", "required": [ "title", "description", "id", "dishes_count" ], "title": "SubMenuRead" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "MenuSummary": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "submenus": { "items": { "$ref": "#/components/schemas/SubMenuSummary" }, "type": "array", "title": "Submenus" } }, "type": "object", "required": [ "title", "description", "id", "submenus" ], "title": "MenuSummary" }, "SubMenuSummary": { "properties": { "title": { "type": "string", "title": "Title" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "dishes": { "items": { "$ref": "#/components/schemas/DishBase" }, "type": "array", "title": "Dishes" } }, "type": "object", "required": [ "title", "description", "id", "dishes" ], "title": "SubMenuSummary" } } }, "tags": [ { "name": "menu", "description": "Операции с меню." }, { "name": "submenu", "description": "Подменю и работа с ним" }, { "name": "dish", "description": "Блюда и работа с ними" }, { "name": "summary", "description": "Вывод всей структуры меню" } ] }