mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04: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,6 +1,7 @@
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.gzip import GZipMiddleware
|
||||
from fastapi.routing import APIRoute
|
||||
|
||||
from mealie.core.config import get_app_settings
|
||||
from mealie.core.root_logger import get_logger
|
||||
@ -78,6 +79,12 @@ def 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")
|
||||
async def system_startup():
|
||||
|
Loading…
x
Reference in New Issue
Block a user