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

+5 -3
View File
@@ -18,6 +18,7 @@ from fastapi import APIRouter, Depends, HTTPException, status
# Check AI Copilot availability
from gns3server.agent import AI_COPILOT_AVAILABLE
from gns3server.api.operation_ids import add_stub_routes
# Conditionally import AI-dependent routes
if AI_COPILOT_AVAILABLE:
@@ -32,15 +33,16 @@ else:
_copilot_router = APIRouter()
_llm_router = APIRouter()
@_chat_router.api_route("/{path:path}", methods=["GET", "POST", "DELETE", "PATCH", "PUT"])
@_copilot_router.api_route("/{path:path}", methods=["GET", "POST", "DELETE", "PATCH", "PUT"])
@_llm_router.api_route("/{path:path}", methods=["GET", "POST", "DELETE", "PATCH", "PUT"])
async def ai_not_available(path: str = ""):
raise HTTPException(
status_code=status.HTTP_501_NOT_IMPLEMENTED,
detail="AI Copilot is not available. Install AI dependencies with: pip install gns3-server[ai-features]",
)
add_stub_routes(_chat_router, ai_not_available, "chat_not_available")
add_stub_routes(_copilot_router, ai_not_available, "copilot_not_available")
add_stub_routes(_llm_router, ai_not_available, "llm_not_available")
from . import (
acl,