diff --git a/dev/code-generation/gen_docs_api.py b/dev/code-generation/gen_docs_api.py index df5e4b857cf..0d88a8a08bf 100644 --- a/dev/code-generation/gen_docs_api.py +++ b/dev/code-generation/gen_docs_api.py @@ -1,5 +1,8 @@ import json +from fastapi import FastAPI +from freezegun import freeze_time + from mealie.app import app from mealie.core.config import determine_data_dir @@ -36,11 +39,12 @@ HTML_PATH = DATA_DIR.parent.parent.joinpath("docs/docs/overrides/api.html") -def generate_api_docs(my_app): +def generate_api_docs(my_app: FastAPI): with open(HTML_PATH, "w") as fd: text = HTML_TEMPLATE.replace("MY_SPECIFIC_TEXT", json.dumps(my_app.openapi())) fd.write(text) if __name__ == "__main__": - generate_api_docs(app) + with freeze_time("2024-01-20T17:00:55Z"): + generate_api_docs(app) diff --git a/docs/docs/overrides/api.html b/docs/docs/overrides/api.html index 5a5e969ef8d..1b259831339 100644 --- a/docs/docs/overrides/api.html +++ b/docs/docs/overrides/api.html @@ -14,7 +14,7 @@
diff --git a/mealie/routes/recipe/__init__.py b/mealie/routes/recipe/__init__.py index f14498372de..646a10ca93c 100644 --- a/mealie/routes/recipe/__init__.py +++ b/mealie/routes/recipe/__init__.py @@ -6,9 +6,9 @@ router = APIRouter() -router.include_router(recipe_crud_routes.router_exports) -router.include_router(recipe_crud_routes.router) +router.include_router(recipe_crud_routes.router_exports, tags=["Recipe: Exports"]) +router.include_router(recipe_crud_routes.router, tags=["Recipe: CRUD"]) router.include_router(comments.router, prefix=prefix, tags=["Recipe: Comments"]) -router.include_router(bulk_actions.router, prefix=prefix, tags=["Recipe: Bulk Exports"]) +router.include_router(bulk_actions.router, prefix=prefix, tags=["Recipe: Bulk Actions"]) router.include_router(shared_routes.router, prefix=prefix, tags=["Recipe: Shared"]) router.include_router(timeline_events.events_router, prefix=prefix, tags=["Recipe: Timeline"]) diff --git a/mealie/routes/recipe/bulk_actions.py b/mealie/routes/recipe/bulk_actions.py index 1f7843ef2e4..e45201349cd 100644 --- a/mealie/routes/recipe/bulk_actions.py +++ b/mealie/routes/recipe/bulk_actions.py @@ -17,7 +17,7 @@ from mealie.schema.response.responses import SuccessResponse from mealie.services.recipe.recipe_bulk_service import RecipeBulkActionsService -router = APIRouter(prefix="/bulk-actions", tags=["Recipe: Bulk Actions"]) +router = APIRouter(prefix="/bulk-actions") @controller(router) diff --git a/mealie/routes/recipe/recipe_crud_routes.py b/mealie/routes/recipe/recipe_crud_routes.py index 302ae1f40da..e21aa9b3117 100644 --- a/mealie/routes/recipe/recipe_crud_routes.py +++ b/mealie/routes/recipe/recipe_crud_routes.py @@ -123,7 +123,7 @@ class FormatResponse(BaseModel): jinja2: list[str] -router_exports = UserAPIRouter(prefix="/recipes", tags=["Recipe: Exports"]) +router_exports = UserAPIRouter(prefix="/recipes") @controller(router_exports) @@ -176,7 +176,7 @@ def get_recipe_as_zip(self, slug: str, token: str): ) -router = UserAPIRouter(prefix="/recipes", tags=["Recipe: CRUD"], route_class=MealieCrudRoute) +router = UserAPIRouter(prefix="/recipes", route_class=MealieCrudRoute) @controller(router) diff --git a/poetry.lock b/poetry.lock index 9b7f138791c..842c7b538f1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiofiles" @@ -660,6 +660,20 @@ files = [ docs = ["furo (>=2022.12.7)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"] +[[package]] +name = "freezegun" +version = "1.5.1" +description = "Let your Python tests travel through time" +optional = false +python-versions = ">=3.7" +files = [ + {file = "freezegun-1.5.1-py3-none-any.whl", hash = "sha256:bf111d7138a8abe55ab48a71755673dbaa4ab87f4cff5634a4442dfec34c15f1"}, + {file = "freezegun-1.5.1.tar.gz", hash = "sha256:b29dedfcda6d5e8e083ce71b2b542753ad48cfec44037b3fc79702e2980a89e9"}, +] + +[package.dependencies] +python-dateutil = ">=2.7" + [[package]] name = "ghp-import" version = "2.1.0" @@ -3400,4 +3414,4 @@ pgsql = ["psycopg2-binary"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "34cb3db74c1e5f37480fbc20b25f09fa577272d1eb8602bad0ce064ee20f1e02" +content-hash = "455f4f29104e6614f7ff7e899cf2d63302cd84dd693b59ee17d48ca05fd39543" diff --git a/pyproject.toml b/pyproject.toml index 31a53a16a93..32bd86c955c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,7 @@ types-python-slugify = "^6.0.0" types-requests = "^2.27.12" types-urllib3 = "^1.26.11" pydantic-to-typescript2 = "^1.0.4" +freezegun = "^1.5.1" [build-system]