I am not sure if mqtt are part of the core development - but I guess, as I don't have to install them extra, that they are part of the core nodes.
When I use the mqtt-in Nodes (and I know that in mqtt this is standard) all messages, which come in are strings or a buffer and therefore this is the default mode.
However with this option to create as output an analyzed JSON object this is fantastic to get real data types (JSON objects and works also for scalar type as booleans and numbers). However with this setting I get a problem in case of strings - that these strings produces an Error that this no JSON string which can be interpreted. For sure this is correct.
I can use a catch node and so I can retrieve the strings still as normal strings.
So at this moment I have to options:
- If I configure the output if the mqtt-in node in default auto - I get everything as strings - which needs a lot of translations to get real numbers and booleans.
- If I use information to get the output as analyzed JSON object - I get real numbers, booleans and JS Objects out of JSON strings - but errors when I recieve normal strings.
So my request is - why it is not possible to combine both options and to get real data- types strings, numbers, booleans and JS Objects or Arrays out of JSON Strings for all mqtt-in messages?
In case no JSON string is detected - the node should simply send a string or buffer - instead of raising an error.