diff --git a/src/ros2_medkit_gateway/src/http/rest_server.cpp b/src/ros2_medkit_gateway/src/http/rest_server.cpp index 516af5da2..392068e6b 100644 --- a/src/ros2_medkit_gateway/src/http/rest_server.cpp +++ b/src/ros2_medkit_gateway/src/http/rest_server.cpp @@ -1620,8 +1620,8 @@ void RESTServer::setup_routes() { for (const auto & et_lc : std::vector>{{"apps", "app"}, {"components", "component"}}) { const std::string base_lc = std::string("/") + et_lc.first + "/{" + et_lc.second + "_id}"; - // e.g. "Apps" / "Components" for operation ID construction - const std::string entity_cap = capitalize(std::string(et_lc.first)); + // e.g. "App" / "Component" for operation ID construction + const std::string entity_cap = capitalize(std::string(et_lc.second)); for (const auto & action : {"start", "restart", "force-restart", "shutdown", "force-shutdown"}) { std::string action_str = action; diff --git a/src/ros2_medkit_integration_tests/test/features/test_docs_endpoint.test.py b/src/ros2_medkit_integration_tests/test/features/test_docs_endpoint.test.py index e5cf93c8a..9db995d0c 100644 --- a/src/ros2_medkit_integration_tests/test/features/test_docs_endpoint.test.py +++ b/src/ros2_medkit_integration_tests/test/features/test_docs_endpoint.test.py @@ -77,6 +77,18 @@ def test_root_docs_returns_openapi_spec(self): f'Root spec should include /apps path. Paths: {list(paths.keys())}' ) + # Lifecycle status operationIds use the singular entity name + # (getAppStatus), not the plural collection name (getAppsStatus). + self.assertEqual( + paths['/apps/{app_id}/status']['get']['operationId'], + 'getAppStatus') + self.assertEqual( + paths['/components/{component_id}/status']['get']['operationId'], + 'getComponentStatus') + self.assertEqual( + paths['/apps/{app_id}/status/restart']['put']['operationId'], + 'putAppStatusRestart') + def test_apps_docs_returns_entity_collection_spec(self): """GET /apps/docs returns spec for apps collection.