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).