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
1 change: 1 addition & 0 deletions backend/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)
from api.orders import router as orders_router
from api.routes import router as api_router
from api.exports import router as exports_router
from api.routes_catalog import router as catalog_router
from api.routes_catalog import router_mesh as catalog_mesh_router
from api.exports import router as exports_router
Expand Down
2 changes: 2 additions & 0 deletions backend/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from services.example_service import ExampleService
from api.shopify_webhook import router as shopify_router
from api.exports import router as exports_router

# Configure logging
logging.basicConfig(level=logging.INFO)
Expand All @@ -20,6 +21,7 @@

# Mount routers
router.include_router(shopify_router)
router.include_router(exports_router)
Comment on lines 22 to +24

Choose a reason for hiding this comment

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

P1 Badge Avoid registering exports router twice with different prefixes

exports_router is included on the aggregate API router and again on the FastAPI app, even though it already wraps routes_cnc (whose path prefix is /api/cnc). The inclusion in backend/api/routes.py adds another /api prefix, so the same endpoint tree is mounted a second time at /api/api/cnc, which causes FastAPI’s schema generation to blow up with AttributeError: 'property' object has no attribute 'schema' and leaves duplicate paths exposed. Register the router in only one place or adjust prefixes so each export route is added once.

Useful? React with 👍 / 👎.



@router.get("/example")
Expand Down
Loading