-
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
Create validation section #187
Comments
Taking in a comment from @benfrancis in #10, for further discussion here:
|
We have two basic alternatives:
"best effort" does not provide any interop guarantees, since it weakens conformance and leaves many implemmentation choices. Let's assume some mandatory fields would be missing. One consumer (A) could just reject the TD, another one (B)would be implementing fallback behavior. A 3rd consumer (C) would implement a different fallback, which has wrong behavior. Strict compliance can provide these guarantees, either a device is compliant or not. There's no room for Pareto, i.e. no 80%:20% compliance. Without strict compliance there won't be an ecosystem of device and cloud manufacturers who adopt WoT. |
I agree with the motivation behind. For maximum interoperability one would need such requirements to be fulfilled and not have room for flexibility. The major problem is that we do not have a certification program or something similar. So even when a TD would validate a JSON Schema validation, we will never be able to say that the behaviour of the Thing is as the spec says. Thus, I would prefer to keep the validation strict but define a normative fallback mechanism as well. |
I agree with @egekorkan. WoT is not like technologies like Wi-Fi, Bluetooth, ZigBee and HomeKit which have trademark-protected formal conformance testing. That's not how W3C recommendations work. A WoT Consumer can not assume that a Thing which claims to conform to a profile actually conforms to that profile. But refusing to communicate with a Thing altogether because of something minor like a missing A Consumer needs to attempt to communicate with a Thing as if it conforms to the profile to which it claims to conform, but degrade gracefully as much as possible when it gets an unexpected result. For example:
|
I think it is good to consider and discuss the proposed fallback mechanisms, and also that there's no formal compliance certification. If we have a schema that enforces the presence of certain keywords, these can be formally verified with a JSON schema validator. If somebody does not pass the schema validation, he is not profile compliant. It is as simple as that. What prevents a developer of a TD to use a title? A description? Why not just provide the minimum set of metadata to ensure interop? |
I don't have a strong opinion either way, but I would like to refer you to the endless discussions why HTML browser do accept and render broken HTML (event without letting the user know that something is broken). I think in the end it boils down to that costumers using an interface wanna see a result. They are simply not interested in errors popping up. Hence, UI vendors will do its best to hide possible errors as long as possible. Having said that, a JSON Schema validation for developer purposes is fine. In reality there will be fallbacks implemented ... |
@mlagally wrote:
In which languages? Even this is not necessarily trivial. I think the important point is not whether the specification should require a title, but what a Consumer should do if a Thing doesn't provide a title (or a title in the user's preferred language). Simply saying that a term is mandatory doesn't provide enough information to implement a robust Consumer which can cope with real world conditions (where titles will inevitably be omitted). Either the Consumer can still function without the title (in which case it isn't really mandatory), or Consumers must stop processing the TD altogether if a title is not provided (which is bad for interoperability). This is why if we want to maximise interoperability we can only really recommend terms like Ideally I think these kinds of fallback mechanisms should be defined in the Thing Description specification, not left down to profiles. This is why I have proposed a deliverable for TD 2.0 which defines "an algorithm for parsing a Thing Description". |
We should revisit Validation in Profile-1.1 |
Describe how validation has to be performed, several levels, tooling?
The text was updated successfully, but these errors were encountered: