C8Y Mapper converts alarms/events to only JSON over MQTT #2242
Labels
improvement
User value
theme:c8y
Theme: Cumulocity related topics
theme:telemetry
Theme: Telemetry data
Is your feature improvement request related to a problem? Please describe.
Cumulocity Mapper converts alarms and events to either SmartREST or JSON over MQTT up to the payload patterns.
My proposal is to stop converting to SmartREST in any case, and converts to only JSON over MQTT.
Why?
The cost of supporting SmartREST with correct validation is quite high compared to the efforts.
We can simplify our current c8y-mapper code and stronger and easier validation for payload by using external JSON crate.
SmartREST is CSV-like format, which causes a problem how to escape special characters. Also, since it's not completely CSV, we cannot use external CSV crate.
For example, if user publishes this payload to the event topic:
The event type
foo,bar
is valid, however, we need an escape for,
in SmartREST, whilst we don't need any escape for JSON over MQTT.Another example, if given type contains
"
:The event type
foo"bar
is valid, however, what do we need to escape"
for SmartREST? Two double-quotes or backslash? If JSON over MQTT, this escape is surely backslash as it is given by input JSON.Describe the solution you'd like
Describe alternatives you've considered
Nothing
Additional context
#2221 (comment)
The text was updated successfully, but these errors were encountered: