-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong json document returned by BootstrapManager::parseQueueMsg when the payload is a numerical value #14
Comments
pull request will be really appreciated, in case I'll not see a pull request I'll do it in the next release :) |
Ok, I will propose soon a pull request after some testing but I saw that a version 1.12.7 is in preparation that seems to address a similar issue. Should I wait that you release this version before ? |
I have just released the 1.2.7, I fixed a similar issue, but I lack the part you pointed out... you can pull request from now on :) |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Hello,
for simple MQTT messages with a numerical value such as:
Topic: SET/TEMP Payload: 21.5
, theparseQueueMsg
function returns a json document which contains only the string21.5
and not as expected{"value":21.5}
.I have tested different MQTT messages:
Topic: CMD Payload: ON
returns{"value":"ON"}
- correctTopic: SET Payload: {"TEMP":21.5}
returns{"TEMP":21.5}
- correctTopic: SET Payload: 21.5
returns21.5
- failedTopic: SET Payload: t1t1
returnstrue
- failed, and I noticed thatdeserializeJson
function was returning no errorThis strange behavior is coming from the deserializeJson function which returns no error when the payload is a numeric value or a string such as 'toto', 't1t1', 'true', 'false' ... but delivers a json object not formatted as expected.
So I have modified the code as below (see modifications in 3rd line):
Then for the example of
Topic: SET Payload: 21.5
returns21.5
, I get the result{"value":21.5}
as expected.Then I suggest to implement this modifications in a future version.
This apply also for the
BootstrapManager::parseHttpMsg
function.The text was updated successfully, but these errors were encountered: