mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-06 05:55:23 +02:00
Fix routes getting listed twice in API documentation (#2079)
* remove duplicate tags from all routes after mounting * fix missing import
This commit is contained in:
parent
f4b819899d
commit
a35bc71e53
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.middleware.gzip import GZipMiddleware
|
from fastapi.middleware.gzip import GZipMiddleware
|
||||||
|
from fastapi.routing import APIRoute
|
||||||
|
|
||||||
from mealie.core.config import get_app_settings
|
from mealie.core.config import get_app_settings
|
||||||
from mealie.core.root_logger import get_logger
|
from mealie.core.root_logger import get_logger
|
||||||
|
@ -78,6 +79,12 @@ def api_routers():
|
||||||
|
|
||||||
api_routers()
|
api_routers()
|
||||||
|
|
||||||
|
# fix routes that would get their tags duplicated by use of @controller,
|
||||||
|
# leading to duplicate definitions in the openapi spec
|
||||||
|
for route in app.routes:
|
||||||
|
if isinstance(route, APIRoute):
|
||||||
|
route.tags = list(set(route.tags))
|
||||||
|
|
||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def system_startup():
|
async def system_startup():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue