feat(api): generate unique readable OpenAPI operationIds

This commit is contained in:
Mark Paronyan committed 2026-10-07 15:53:00 +03:00
1 parent 2fb7056cb9
commit 6ed9e44f00
5 files changed
+149 -4

No files matched your search

+4 -1
View File
@@ -36,6 +36,7 @@ from uvicorn.main import Server as UvicornServer
# MCP is an optional feature — import only if dependencies are installed
from gns3server.agent import MCP_AVAILABLE
from gns3server.api.operation_ids import add_stub_routes, generate_operation_id
from gns3server.api.routes import controller, index
from gns3server.api.routes.compute import compute_api
from gns3server.controller.controller_error import (
@@ -58,13 +59,14 @@ else:
_mcp_router = APIRouter(prefix="/mcp", tags=["MCP"])
@_mcp_router.api_route("/{path:path}", methods=["GET", "POST", "DELETE", "PATCH", "PUT"])
async def mcp_not_available(path: str = ""):
raise HTTPException(
status_code=status.HTTP_501_NOT_IMPLEMENTED,
detail="MCP is not available. Install AI dependencies with: pip install gns3-server[ai-features]",
)
add_stub_routes(_mcp_router, mcp_not_available, "not_available")
import logging
@@ -80,6 +82,7 @@ def get_application() -> FastAPI:
version="3.0.0",
docs_url=None,
redoc_url=None,
generate_unique_id_function=generate_operation_id,
)
application.add_middleware(