-
Notifications
You must be signed in to change notification settings - Fork 8
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
Evaluate Data Schema Constraints #3
Comments
This example has a nesting level of 3. |
I agree that forbidding data models nesting to one level of nesting is unnecessarily restrictive and will cause more interoperability problems than it will solve. There are several additional examples for OCF devices that use greater nesting, and actually, TD themselves are a complex JSON file with deep nesting, so... It is also not that big a deal to parse nested JSON structures on memory-limited devices; with an efficient parser a stack with only a few bytes per level would be needed. Handling the (required...) strings for descriptions will take more space, typically. It might still, however, be useful to define a finite level of nesting. The real question is how we figure out what it should be. I would guess arbitrarily however that a nesting level of 10 (say) would cover nearly all the payloads for practical devices without unduly stressing even small devices. |
I should also mention that we want people to be able to use standard libraries for JSON, etc. If we add constraints "to make things simpler" then people might have to implement special libraries to be conformant, which would be a burden, and might even lead to undesirable things like having two JSON libraries on a device (one general-purpose, one special-cased). |
Philips Hue seems to really like 2 nested levels. Example can be found here |
Does a profile really need to define additional constraints for the Thing Description itself, or should it focus on defining the data format for data payloads as part of a protocol binding definition? |
This seems to be related to database normalization from cloud management pov. |
There seems to be a consensus here that a constraint on nested data structures (as currently defined by section 5.1.3.1) is not desirable. |
See also my comments in #10 and extensive review feedback in #93 (review) |
See also comments in #37 |
Note: This is a subset of the discussion in #10 |
I just found this guideline for device twins in Azure:
|
@sebastiankb |
@mlagally |
We have removed these constraints, suggest we close the issue. |
I believe we need to be careful about constraints (e.g., forbidding nested structures).
Ikea Tradfri has nested objects, see https://github.com/glenndehaan/ikea-tradfri-coap-docs#payload
e.g., switching on a lamp
Note: Tradfri uses COAP
The text was updated successfully, but these errors were encountered: