-
Notifications
You must be signed in to change notification settings - Fork 408
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
Json deserialization we should not add "/" when missing #651
Comments
The issues :
|
This is fixed since #762 is integrated in master |
Hi Simon I'm evaluating possibility of upgrading Leshan to higher version for my project. I see there was a difference between 1.0.0-M12 and 1.0.0-M13, which was introduced by this issue. Since Leshan 1.0.0-M13, there is explicit declaration in LwM2M JSON decoder, as I copy/paste below. Decoder requires that LwM2M Resource Path of JSON payload MUST as the same as request path. Would be appreciate if you can share some background about this issue or reason behind?
|
Hi, I strongly advice to migrate to last 1.x version. (currently v1.3.1) Using Milestone version only makes sense if you need features which are not yet available in the stable version. (like using 2.0.0-M? to get LWM2M v1.1 features) Anyway back to your question,
I don't know what I can explain more than what is already explained in comment above 🤔 :
In particular : "we MUST NOT use request path as base name if base name is absent !" About this test
(source lwm2m-v1.0.2§6.4.4-JSOn) // check returned path is under requested path
if (requestPath.getObjectId() != null && path.getObjectId() != null) {
if (!path.getObjectId().equals(requestPath.getObjectId())) {
throw new CodecException("resource path [%s] does not match requested path [%s].", path, requestPath);
}
} The idea of this check is to ensure that JSON value only contains resource which is under the requested path. If you face some devices which do not respect the specification you can eventually create a custom JSON encoder/decoder. (of course better is to fix devices but not always possible :-/)
HTH |
It seems we are too "smart" and we should not add "/" in json path.
(see OpenMobileAlliance/OMA_LwM2M_for_Developers#380)
The text was updated successfully, but these errors were encountered: