api documentation

This commit is contained in:
Hayden committed 2021-01-07 19:51:11 -09:00
1 parent 048114f2f2
commit df0d7c9ac5
6 files changed
+37 -56

No files matched your search

-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>My Project - ReDoc</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://fastapi.tiangolo.com/img/favicon.png">
<style>
body {
margin: 0;
padding: 0;
}
</style>
<style data-styled="" data-styled-version="4.4.1"></style>
</head>
<body>
<div id="redoc-container"></div>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
<script>
var spec = {"openapi": "3.0.2", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/api/all-recipes/": {"get": {"tags": ["Recipes"], "summary": "Get All Recipes", "description": "Returns key data for all recipes ", "operationId": "get_all_recipes_api_all_recipes__get", "parameters": [{"required": true, "schema": {"title": "Keys", "type": "array", "items": {"type": "string"}}, "name": "keys", "in": "query"}, {"required": false, "schema": {"title": "Num", "type": "integer", "default": 100}, "name": "num", "in": "query"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/": {"get": {"tags": ["Recipes"], "summary": "Get Recipe", "description": "Takes in a recipe slug, returns all data for a recipe ", "operationId": "get_recipe_api_recipe__recipe_slug___get", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/image/{recipe_slug}/": {"get": {"tags": ["Recipes"], "summary": "Get Recipe Img", "description": "Takes in a recipe slug, returns the static image ", "operationId": "get_recipe_img_api_recipe_image__recipe_slug___get", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/create-url/": {"post": {"tags": ["Recipes"], "summary": "Get Recipe Url", "description": "Takes in a URL and Attempts to scrape data and load it into the database ", "operationId": "get_recipe_url_api_recipe_create_url__post", "requestBody": {"content": {"application/json": {"schema": {"title": "Url", "type": "object"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/create/": {"post": {"tags": ["Recipes"], "summary": "Create From Json", "description": "Takes in a JSON string and loads data into the database as a new entry", "operationId": "create_from_json_api_recipe_create__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Recipe"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/update/image/": {"post": {"tags": ["Recipes"], "summary": "Update Image", "description": "Removes an existing image and replaces it with the incoming file. ", "operationId": "update_image_api_recipe__recipe_slug__update_image__post", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "requestBody": {"content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/Body_update_image_api_recipe__recipe_slug__update_image__post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/update/": {"post": {"tags": ["Recipes"], "summary": "Update", "description": "Updates a recipe by existing slug and data. Data should containt ", "operationId": "update_api_recipe__recipe_slug__update__post", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Recipe"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/delete/": {"delete": {"tags": ["Recipes"], "summary": "Delete", "description": "Deletes a recipe by slug ", "operationId": "delete_api_recipe__recipe_slug__delete__delete",Line truncated
Redoc.init(spec, {}, document.getElementById("redoc-container"));
</script>
</body>
</html>
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>My Project - ReDoc</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://fastapi.tiangolo.com/img/favicon.png">
<style>
body {
margin: 0;
padding: 0;
}
</style>
<style data-styled="" data-styled-version="4.4.1"></style>
</head>
<body>
<div id="redoc-container"></div>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
<script>
var spec = {"openapi": "3.0.2", "info": {"title": "Mealie", "description": "A place for all your recipes", "version": "0.0.1"}, "paths": {"/api/all-recipes/": {"get": {"tags": ["Recipes"], "summary": "Get All Recipes", "description": "Returns key data for all recipes based off the query paramters provided.\nFor example, if slug, image, and name are provided you will recieve a list of\nrecipes containing the slug, image, and name property. By default, responses\nare limited to 100.\n\n**Note:** You may experience problems with with query parameters. As an alternative\nyou may also use the post method and provide a body.\nSee the *Post* method for more details.", "operationId": "get_all_recipes_api_all_recipes__get", "parameters": [{"required": true, "schema": {"title": "Keys", "type": "array", "items": {"type": "string"}}, "name": "keys", "in": "query"}, {"required": false, "schema": {"title": "Num", "type": "integer", "default": 100}, "name": "num", "in": "query"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecipeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"tags": ["Recipes"], "summary": "Get All Recipes Post", "description": "Returns key data for all recipes based off the body data provided.\nFor example, if slug, image, and name are provided you will recieve a list of\nrecipes containing the slug, image, and name property.\n\nRefer to the body example for data formats.", "operationId": "get_all_recipes_post_api_all_recipes__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllRecipeRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecipeResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/": {"get": {"tags": ["Recipes"], "summary": "Get Recipe", "description": "Takes in a recipe slug, returns all data for a recipe ", "operationId": "get_recipe_api_recipe__recipe_slug___get", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Recipe"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/image/{recipe_slug}/": {"get": {"tags": ["Recipes"], "summary": "Get Recipe Img", "description": "Takes in a recipe slug, returns the static image ", "operationId": "get_recipe_img_api_recipe_image__recipe_slug___get", "parameters": [{"required": true, "schema": {"title": "Recipe Slug", "type": "string"}, "name": "recipe_slug", "in": "path"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/create-url/": {"post": {"tags": ["Recipes"], "summary": "Parse Recipe Url", "description": "Takes in a URL and attempts to scrape data and load it into the database ", "operationId": "parse_recipe_url_api_recipe_create_url__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecipeURLIn"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SlugResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/create/": {"post": {"tags": ["Recipes"], "summary": "Create From Json", "description": "Takes in a JSON string and loads data into the database as a new entry", "operationId": "create_from_json_api_recipe_create__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Recipe"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SlugResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/recipe/{recipe_slug}/update/image/": {"post": {"tags": ["Recipes"], "summary": "Update Recipe Image", "description": "Removes an existing image and replaces it with the incoming file. ", "operationId": "update_recipe_image_api_recipe__recipe_slug__update_image__post", "parameters": [{"required": true, "sLine truncated
Redoc.init(spec, {}, document.getElementById("redoc-container"));
</script>
</body>
</html>