Skip to content

Enhancement: check if entry in JSON #65

@step135

Description

@step135
const char* sensor = doc["sensor"] | "unknown";

That could be ok, but when I use byte type and want to have all 256 numbers disponible, there is no solution.
I like that in Python I am able to do the check: using in. I need to implement following logic:

byte temp = 24; //default value
if("temp" in doc["temp"]) temp = doc["temp"]; //ovewriting the value if it is in JSON

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions