Open lu-zero opened 1 year ago
Just a thought, but not all protocols use "verbs", in fact possibly only HTTP and CoAP follow that pattern (e.g. See the MQTT and Modbus binding documents).
Non-default bindings are also rarely as simple as just one vocabulary term, so you'd actually need a map of maps. At that point it may just be simpler/clearer to provide separate forms.
mqtt uses 3 verbs and they cannot be overridden (I already discussed about removing mqv:controlPacket
for that reason with @relu91), on the other hand modbus has some variety of modbus:function
that act as verbs.
I'm fine with either having the verb
field, the map or even deprecating the op-Array form. Just I'd avoid having an open ambiguity if we can easily avoid it.
Yes, I was quite surprised how the concept of verbs could be adapted to MQTT and Modbus too. Still, I'm a little bit unsure if this can be transposed to also any future protocol that we could support.
I probably need to think more about this issue, because I don't dislike even a more drastic solution of deprecating the op-Array form.
The protocol bindings usually extend Form in two ways:
If the default mapping is used and only
op
is different in Forms, they can be collapsed in a single one with an Array.Would be good to either have an explicit
verb
field that is a single-entry to structurally prevent having invalid Forms with an explicit verb ANDop
in Array from or add a third form forop
as aMap<opstring, verb>
.Originally discussed in https://github.com/w3c/wot-binding-templates/issues/194