Closed mkrstic closed 7 years ago
Thanks for the report.
This is not a JSON related problem, but rather a consequence of Connectivity Monitoring Object read handler being broken - it currently (erroneously) returns an empty string instead of an empty array of resources - we are aware of this, and will fix it soon.
Anjay indeed returns an empty JSON list, on attempt to read an empty Multiple
Resource. You could observe this by issuing Read on some Multiple Resources
implemented in Anjay's Test Object (/1337
):
create /1337
=> created /1337/1
read /1337/1/3 accept=JSON
=> {"bn":"/1337/1/3","e":[]}
It might however be confusing that the same resource (/1337/1/3
) won't
be reported in response to a Read on entire Instance - it doesn't look like
it's representable (according to the LwM2M specification).
I see. Thank you for your quick reply!
This is now fixed in 1.3.1.
I observed strange behavior when reading empty multi-resources. Here is the flow:
It seems to me that client response is not correct, or at least ambiguous, because it indicates that /4/0/7 is single value resource.
Spec says:
I think client should have sent either: a) If there is a single value then {"bn":"/4/0/7/0","e":[{"sv":""}]} or {"bn":"/4/0/7","e":[{"n": "/0", "sv":""}]} b) {"bn":"/4/0/7","e":[]} when values are absent. Maybe more appropriate would be to send 4.04 Not Found in this situation.