Function ros2_medkit_gateway::parse_entity_path
Defined in File entity_path_utils.hpp
Function Documentation
-
std::optional<EntityPathInfo> ros2_medkit_gateway::parse_entity_path(const std::string &request_path)
Parse entity path from HTTP request URL.
Extracts entity type, ID, and resource path from URLs like:
/api/v1/apps/{id}/… -> APP, id, …
/api/v1/components/{id}/… -> COMPONENT, id, …
/api/v1/areas/{id}/… -> AREA, id, …
/api/v1/functions/{id}/… -> FUNCTION, id, …
/api/v1/areas/{parent}/subareas/{id}/… -> AREA, id, parent
/api/v1/components/{parent}/subcomponents/{id}/… -> COMPONENT, id, parent
- Parameters:
request_path – Full request path (e.g., “/api/v1/apps/motor/faults”)
- Returns:
Parsed EntityPathInfo, or std::nullopt if path doesn’t match any pattern