Skip to content

Add option to enforce validation based on referenced WoT model #1650

@thjaeckle

Description

@thjaeckle

Currently, Ditto's WoT Integration does not ensure/enforce the referenced model.

As the reference implementation, Eclipse Thingweb did also not do that we thought that would be a common practice to move validation to eg producers of messages.

In practice I now see that an enforcement of the model by Ditto would have great benefits and is the best place to add validation.
This would eg ensure that different API consumers always modify a thing only in the intended and modeled way.

That would be especially important if the Ditto managed twin is used in an Event driven system, where changes of the twin state is reacted to by eg issuing a command downlink to an actual device (using "desired properties" approach).

This issue should track:

  • new config option to enable wot validation
  • implementation and making configurable all of the below:
    • validation of attributes on thing level
    • validation of properties of features
    • validation of desired properties of features (ignoring "required" constraints)
    • validation of thing messages
    • validation of feature messages
    • whether to allow modifying non modeled attributes/properties or to reject them
    • whether to allow sending of non modeled messages (wot actions/events) or to reject them

I expect this to be quite difficult to do, as we have to extract the JsonSchema parts from WoT TM models and apply them.
Both when eg a complete thing is modified and also partially, when eg only a single feature or even property or even part of a property is modified.

Metadata

Metadata

Assignees

Labels

WoTWeb of Things related enhancements

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions