mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge pull request #2924 from markparonyan/mypy-api-plus
fix(typing): resolve mypy errors in api + compute.dynamips + compute.iou + compute.vpcs + controller
This commit is contained in:
7 files changed
+37
-42
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user