Summary
The fault-trigger CRUD routes are still registered with RouteRegistry::raw(), so their request and response bodies are written by hand instead of coming from a DTO descriptor.
In src/ros2_medkit_gateway/src/http/rest_server.cpp the three routes GET, POST and DELETE on /{entity}/fault-triggers use ->raw(...). The comment above them explains the reason as "no typed DTO".
That reason is no longer true. Three typed DTOs exist and are registered in AllDtos:
FaultTriggerRule
FaultTriggerRuleCreateRequest
FaultTriggerRuleList
So the schemas are generated, but the routes do not use them. The body a client sends is still parsed by hand, and the body the gateway returns is still built by hand. If one side changes, nothing fails.
Proposed solution (optional)
Register the three routes as typed routes using the DTOs that already exist, and drop the raw() calls. The response body is built from FaultTriggerEngine::rule_to_json, so the DTO has to describe exactly what that function returns, or the change moves the mismatch instead of removing it.
If some part cannot be typed, keep raw() for that part only and update the comment to say what actually blocks it.
Additional context (optional)
raw() stays useful for routes that have no fixed shape. The point here is only that these three do have one now.
Summary
The fault-trigger CRUD routes are still registered with
RouteRegistry::raw(), so their request and response bodies are written by hand instead of coming from a DTO descriptor.In
src/ros2_medkit_gateway/src/http/rest_server.cppthe three routesGET,POSTandDELETEon/{entity}/fault-triggersuse->raw(...). The comment above them explains the reason as "no typed DTO".That reason is no longer true. Three typed DTOs exist and are registered in
AllDtos:FaultTriggerRuleFaultTriggerRuleCreateRequestFaultTriggerRuleListSo the schemas are generated, but the routes do not use them. The body a client sends is still parsed by hand, and the body the gateway returns is still built by hand. If one side changes, nothing fails.
Proposed solution (optional)
Register the three routes as typed routes using the DTOs that already exist, and drop the
raw()calls. The response body is built fromFaultTriggerEngine::rule_to_json, so the DTO has to describe exactly what that function returns, or the change moves the mismatch instead of removing it.If some part cannot be typed, keep
raw()for that part only and update the comment to say what actually blocks it.Additional context (optional)
raw()stays useful for routes that have no fixed shape. The point here is only that these three do have one now.