Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RAGManager/app/api/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
"""API routes package."""

from fastapi import APIRouter

from app.api.routes import documents

router = APIRouter(prefix="/api/v1")

router.include_router(documents.router)
Comment on lines +7 to +9
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API versioning prefix "/api/v1" introduces a breaking change. The documents endpoint will now be accessible at "/api/v1/documents/..." instead of "/documents/...". Existing clients will receive 404 errors unless they update their endpoints. Consider implementing redirects from old paths or documenting this breaking change clearly in release notes.

Suggested change
router = APIRouter(prefix="/api/v1")
router.include_router(documents.router)
# Root router (no prefix) to preserve existing unversioned endpoints,
# e.g. /documents/...
router = APIRouter()
# Versioned router for new clients, e.g. /api/v1/documents/...
versioned_router = APIRouter(prefix="/api/v1")
# Include document routes both unversioned and versioned
router.include_router(documents.router)
versioned_router.include_router(documents.router)
# Mount the versioned router under the root router
router.include_router(versioned_router)

Copilot uses AI. Check for mistakes.
Empty file removed RAGManager/app/api/routes/admin.py
Empty file.
11 changes: 11 additions & 0 deletions RAGManager/app/api/routes/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from fastapi import APIRouter

router = APIRouter(tags=["base"])

@router.get("/")
async def root():
return {"message": "RAGManager up"}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root endpoint response message has changed from "Hello World" to "RAGManager up". This is a breaking change that could affect clients expecting the original message. Consider maintaining backward compatibility or documenting this as a breaking change.

Suggested change
return {"message": "RAGManager up"}
return {"message": "Hello World"}

Copilot uses AI. Check for mistakes.

@router.get("/health")
def health_check():
return {"message": "200 running..."}
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The health check response message has changed from "200 corriendo..." to "200 running...". This is a breaking change that could affect clients expecting the original Spanish message. Consider maintaining backward compatibility or documenting this as a breaking change.

Suggested change
return {"message": "200 running..."}
return {"message": "200 corriendo..."}

Copilot uses AI. Check for mistakes.
24 changes: 7 additions & 17 deletions RAGManager/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
from fastapi import FastAPI
from sqlalchemy.exc import OperationalError

from app.api.routes import documents
from app.api.routes import router as api_router
from app.api.routes.base import router as base_router
from app.core.database_connection import init_db

# Configure logging
Expand All @@ -13,9 +13,11 @@

app = FastAPI(title="RAG Manager API", version="0.1.0")

# Include routers
app.include_router(documents.router)
# Global (non-versioned) routes
app.include_router(base_router)

# Versioned API routes
app.include_router(api_router)

@app.on_event("startup")
async def startup_event():
Expand All @@ -25,16 +27,4 @@ async def startup_event():
logging.info("Database initialized successfully")
except Exception as e:
logging.error(f"Failed to initialize database: {e}")
raise


@app.get("/")
async def root():
return {"message": "Hello World"}


@app.get("/health")
def health_check():
return {"message": "200 corriendo..."}


raise