Open
Description
Hello again!
The filtering feature is incredibly useful, although at the moment it's currently limited to including / excluding keys. Would it be possible to extend the filtering feature to limit values to a given size?
My suggested API would be the same as the current filtering API, except that instead of setting a key to 'true' to save it you would set the key to the number of characters to parse. Using JsonFilterExample.ino as a demo:
StaticJsonDocument<200> filter;
filter["list"][0]["dt"] = 10; // max of 10 characters long (excluding terminator)
filter["list"][0]["main"]["temp"] = 4; // ibid, 4 characters long
Key values that are larger than the specified amount would be truncated.
The benefit would be that it would be easier to control the size of the JSON document, as unexpectedly large fields would no longer take up additional memory.