w3c / wot-binding-templates

Web of Things (WoT) Binding Templates
http://w3c.github.io/wot-binding-templates/
Other
22 stars 25 forks source link

Handling of non-body payloads per protocol binding #219

Open egekorkan opened 1 year ago

egekorkan commented 1 year ago

I had an offline chat with @lu-zero and we have a bit of a "lack of describabilty" problem when it comes to how the data is passed in a protocol. We are assuming the following:

This has the following problem:

Proposal for 2.0: A way to map from forms to the data schema for building complex inputs. This means that we can have a single data schema and some keywords in the form describe where this kind of input should go. Some kind of JSON Path or JSONata rules can help with this kind of mapping language. This would not make the simple cases more complex (simple input in payload) but would allow other cases to be described inside forms, giving flexibility per protocol/form.

egekorkan commented 1 year ago

Also, this can actually solve the problem of the platforms/standards that send big objects but only one part of the object is relevant for the affordance. So we can think of a way to point to and map to different parts of the header or payload and say that this is what the affordance actually uses and the rest can be ignored.

lu-zero commented 1 year ago

This is similar to the problem we are tackling to have a precise mapping between elements of the input object and the risk/hazard system we are working on in @sifis-home, probably the same pattern can be used to address both.