fix(typing): resolve mypy errors in api.server

This commit is contained in:
Mark Paronyan 2026-09-28 05:00:02 +00:00
parent b9192438c9
commit 68368220f2
No known key found for this signature in database
GPG Key ID: 8DC7338A87FE22F8
2 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,8 @@
FastAPI app
"""
from typing import cast
from fastapi import FastAPI, Request, HTTPException, status
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
@ -118,7 +120,7 @@ def handle_exit(*args, **kwargs):
unicorn_exit_handler(*args, **kwargs)
UvicornServer.handle_exit = handle_exit
UvicornServer.handle_exit = handle_exit # type: ignore[method-assign]
# Configure self-hosting JavaScript and CSS for docs
@ -134,7 +136,7 @@ async def custom_swagger_ui_html():
)
@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
@app.get(cast(str, app.swagger_ui_oauth2_redirect_url), include_in_schema=False)
async def swagger_ui_redirect():
return get_swagger_ui_oauth2_redirect_html()

View File

@ -355,7 +355,6 @@ module = [
"gns3server.api.routes.controller.snapshots", # 1
"gns3server.api.routes.controller.templates", # 10
"gns3server.api.routes.controller.users", # 14
"gns3server.api.server", # 2
"gns3server.compute.dynamips.nodes.router", # 2
"gns3server.compute.iou.utils.iou_export", # 2
"gns3server.compute.iou.utils.iou_import", # 2