Template Function ros2_medkit_gateway::dto::sample_value

Function Documentation

template<class U>
U ros2_medkit_gateway::dto::sample_value()

Canonical value for a non-DTO field type. DTO-typed members never reach here - dto_sample::make handles them directly.

Round-trip note: for opaque nlohmann::json fields the canonical value is an empty object ({}) rather than the default-constructed nlohmann::json{} (which is JSON null). This matters when the field is wrapped in std::optional<nlohmann::json>: the reader treats JSON null as “absent”, so a default-constructed sample would lose the field on round-trip even though the writer happily emitted it.