{ "swagger": "2.0", "info": { "title": "Domicile API", "contact": {}, "version": "0.1" }, "paths": { "/api/v1/recipes": { "get": { "description": "Get list of all recipes", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes" ], "summary": "List recipes", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes" ], "summary": "Create recipe", "parameters": [ { "description": "Recipe data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.createRecipeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes" ], "summary": "Delete recipe", "parameters": [ { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/api/v1/recipes/{id}": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes" ], "summary": "Get recipe by ID", "parameters": [ { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/recipes.RecipeResponse" } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes" ], "summary": "Update recipe", "parameters": [ { "description": "Recipe data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.updateRecipeRequest" } } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } }, "/api/v1/recipes/{id}/ingredient": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "ingredients" ], "summary": "Update recipe ingredient", "parameters": [ { "description": "Ingredient data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.updateIngredientRequest" } }, { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "ingredients" ], "summary": "Delete recipe ingredient", "parameters": [ { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } }, "/api/v1/recipes/{id}/ingredients": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "ingredients" ], "summary": "Create recipe ingredient", "parameters": [ { "description": "Ingredient data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.createIngredientRequest" } }, { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } }, "/api/v1/recipes/{id}/instruction": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "instructions" ], "summary": "Update recipe instruction", "parameters": [ { "description": "Instruction data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.updateInstructionRequest" } }, { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "instructions" ], "summary": "Delete recipe instruction", "parameters": [ { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } }, "/api/v1/recipes/{id}/instructions": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "recipes", "instructions" ], "summary": "Create recipe instruction", "parameters": [ { "description": "Instruction data", "name": "message", "in": "body", "required": true, "schema": { "$ref": "#/definitions/recipes.createInstructionRequest" } }, { "type": "integer", "description": "Recipe ID", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.Recipe" } } } } } }, "definitions": { "github_com_domicileapp_domicile_internal_db.ListRecipeIngredientsRow": { "type": "object", "properties": { "group_name": { "type": "string" }, "id": { "type": "integer" }, "ingredient_name": { "type": "string" }, "parse_status": { "type": "string" }, "preparation": { "type": "string" }, "quantity": { "type": "number" }, "raw_text": { "type": "string" }, "recipe_id": { "type": "integer" }, "sort_order": { "type": "number" }, "unit": { "type": "string" } } }, "github_com_domicileapp_domicile_internal_db.ListRecipeInstructionsRow": { "type": "object", "properties": { "content": { "type": "string" }, "group_name": { "type": "string" }, "id": { "type": "integer" }, "recipe_id": { "type": "integer" }, "sort_order": { "type": "number" } } }, "github_com_domicileapp_domicile_internal_db.Recipe": { "type": "object", "properties": { "cook_time": { "type": "string" }, "created_at": { "type": "string" }, "deleted_at": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "notes": { "type": "string" }, "nutrition": { "type": "string" }, "prep_time": { "type": "string" }, "servings": { "type": "string" }, "short_description": { "type": "string" }, "source": { "type": "string" }, "updated_at": { "type": "string" } } }, "recipes.RecipeResponse": { "type": "object", "properties": { "cook_time": { "type": "string" }, "created_at": { "type": "string" }, "deleted_at": { "type": "string" }, "id": { "type": "integer" }, "ingredients": { "type": "array", "items": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.ListRecipeIngredientsRow" } }, "instructions": { "type": "array", "items": { "$ref": "#/definitions/github_com_domicileapp_domicile_internal_db.ListRecipeInstructionsRow" } }, "name": { "type": "string" }, "notes": { "type": "string" }, "nutrition": { "type": "string" }, "prep_time": { "type": "string" }, "servings": { "type": "string" }, "short_description": { "type": "string" }, "source": { "type": "string" }, "updated_at": { "type": "string" } } }, "recipes.createIngredientRequest": { "type": "object", "properties": { "group_name": { "type": "string" }, "raw_text": { "type": "string" }, "sort_order": { "type": "number" } } }, "recipes.createInstructionRequest": { "type": "object", "properties": { "content": { "type": "string" }, "group_name": { "type": "string" }, "sort_order": { "type": "number" } } }, "recipes.createRecipeRequest": { "type": "object", "properties": { "name": { "type": "string" }, "short_description": { "type": "string" } } }, "recipes.updateIngredientRequest": { "type": "object", "properties": { "raw_text": { "type": "string" }, "sort_order": { "type": "number" } } }, "recipes.updateInstructionRequest": { "type": "object", "properties": { "content": { "type": "string" }, "sort_order": { "type": "number" } } }, "recipes.updateRecipeRequest": { "type": "object", "properties": { "name": { "type": "string" }, "short_description": { "type": "string" } } } } }