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
4 changes: 2 additions & 2 deletions src/ros2_medkit_gateway/src/http/rest_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,8 +1620,8 @@ void RESTServer::setup_routes() {
for (const auto & et_lc :
std::vector<std::pair<const char *, const char *>>{{"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));
Comment thread
mfaferek93 marked this conversation as resolved.

for (const auto & action : {"start", "restart", "force-restart", "shutdown", "force-shutdown"}) {
std::string action_str = action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading