{"openapi":"3.0.3","info":{"title":"Моя Кухня — Recipe API","description":"Учебный REST API для Android-приложения (Compose · MVVM · Room · Retrofit).\n\n**Base URL:** `https://recipe.product-solutions.ru/api/v1`","version":"1.0.0"},"servers":[{"url":"https://recipe.product-solutions.ru/api/v1","description":"Production"},{"url":"http://127.0.0.1:3010/api/v1","description":"Local"}],"tags":[{"name":"Health"},{"name":"Home"},{"name":"Recipes"},{"name":"Saved"},{"name":"Categories"},{"name":"Profile"}],"paths":{"/health":{"get":{"tags":["Health"],"summary":"Healthcheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"},"version":{"type":"string"}}}}}}}}},"/home":{"get":{"tags":["Home"],"summary":"Данные главного экрана","responses":{"200":{"description":"featured + categories + tryToday","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeResponse"}}}}}}},"/categories":{"get":{"tags":["Categories"],"summary":"Список категорий","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}}}}}}},"/recipes":{"get":{"tags":["Recipes"],"summary":"Список / поиск / фильтры","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Поиск по названию, описанию, ингредиентам"},{"name":"maxTime","in":"query","schema":{"type":"integer","example":30},"description":"Максимум минут"},{"name":"meal","in":"query","schema":{"type":"string","enum":["завтрак","обед","ужин"]}},{"name":"meatFree","in":"query","schema":{"type":"boolean"}},{"name":"cuisine","in":"query","schema":{"type":"string","example":"итальянская"}},{"name":"category","in":"query","schema":{"type":"string","example":"Ужин"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["popularity","rating","newest"],"default":"popularity"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":24}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeListResponse"}}}}}},"post":{"tags":["Recipes"],"summary":"Создать рецепт (published или draft)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recipe"}}}}}}},"/recipes/{id}":{"get":{"tags":["Recipes"],"summary":"Детали рецепта","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","example":3}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recipe"}}}},"404":{"description":"Not found"}}},"patch":{"tags":["Recipes"],"summary":"Обновить рецепт","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeCreate"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recipe"}}}},"404":{"description":"Not found"}}}},"/recipes/{id}/save":{"post":{"tags":["Saved"],"summary":"Добавить в сохранённое","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}},"delete":{"tags":["Saved"],"summary":"Убрать из сохранённого","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/saved":{"get":{"tags":["Saved"],"summary":"Сохранённые рецепты и коллекции","parameters":[{"name":"collection","in":"query","schema":{"type":"string","example":"all"},"description":"all | id/название коллекции"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedResponse"}}}}}}},"/profile":{"get":{"tags":["Profile"],"summary":"Профиль текущего пользователя","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}},"patch":{"tags":["Profile"],"summary":"Редактировать профиль","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"handle":{"type":"string"},"city":{"type":"string"},"bio":{"type":"string"},"avatarUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}}},"/profile/recipes":{"get":{"tags":["Profile"],"summary":"Мои опубликованные рецепты","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeListSimple"}}}}}}},"/profile/drafts":{"get":{"tags":["Profile"],"summary":"Черновики","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipeListSimple"}}}}}}}},"components":{"schemas":{"Ingredient":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"number"},"unit":{"type":"string"}}},"Step":{"type":"object","properties":{"number":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"}}},"RecipeCard":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"imageUrl":{"type":"string"},"cookingTimeMinutes":{"type":"integer"},"difficulty":{"type":"string"},"rating":{"type":"number"},"calories":{"type":"integer"},"category":{"type":"string"},"cuisine":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"meal":{"type":"string"},"meatFree":{"type":"boolean"},"spiciness":{"type":"string","nullable":true},"isFeatured":{"type":"boolean"},"isSaved":{"type":"boolean"},"status":{"type":"string","enum":["published","draft"]},"savesCount":{"type":"integer"},"authorName":{"type":"string"}}},"Recipe":{"allOf":[{"$ref":"#/components/schemas/RecipeCard"},{"type":"object","properties":{"description":{"type":"string"},"servings":{"type":"integer"},"authorId":{"type":"string"},"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/Ingredient"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"}}}}]},"RecipeCreate":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"},"cookingTimeMinutes":{"type":"integer"},"difficulty":{"type":"string"},"calories":{"type":"integer"},"servings":{"type":"integer"},"category":{"type":"string"},"cuisine":{"type":"string"},"meal":{"type":"string"},"meatFree":{"type":"boolean"},"status":{"type":"string","enum":["published","draft"]},"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/Ingredient"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"}}}},"RecipeListResponse":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/RecipeCard"}}}},"RecipeListSimple":{"type":"object","properties":{"total":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/RecipeCard"}}}},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"iconKey":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string"},"city":{"type":"string"},"bio":{"type":"string"},"avatarUrl":{"type":"string"},"recipesCount":{"type":"integer"},"savesCount":{"type":"integer"},"followersCount":{"type":"integer"},"draftsCount":{"type":"integer"}}},"HomeResponse":{"type":"object","properties":{"greetingName":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":"string"}}},"featured":{"$ref":"#/components/schemas/Recipe"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"tryToday":{"type":"array","items":{"$ref":"#/components/schemas/RecipeCard"}}}},"SavedResponse":{"type":"object","properties":{"totalRecipes":{"type":"integer"},"totalCollections":{"type":"integer"},"collections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"recipeCount":{"type":"integer"}}}},"recent":{"$ref":"#/components/schemas/RecipeCard"},"forWeek":{"type":"array","items":{"$ref":"#/components/schemas/RecipeCard"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/RecipeCard"}}}}}}}