mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-30 07:40:12 +03:00
fix(typing): resolve mypy errors in api.server
This commit is contained in:
parent
b9192438c9
commit
68368220f2
@ -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()
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user