Page MenuHomeVyOS Platform

HTTP API: server fails to start with FastAPI versions that keep included routers as one route
Open, Requires assessmentPublic

Description

Newer FastAPI releases (seen with 0.165) add an included router to the application as a single route entry without a path, instead of copying its routes. The HTTP API server walks the application routes during start-up and on every reload (to refresh the docs and GraphQL routes and to log them) and assumes every entry has a path, so it fails with an AttributeError and the API service does not start. REST enable/disable on reload also relies on finding the copied routes.

Make the route handling work with both behaviours. Required before upgrading FastAPI in vyos-http-api-tools (T9571).

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)