Wot-thing-description: Improve the text on Action parameters (vs input)

Created on 12 Jun 2020  路  5Comments  路  Source: w3c/wot-thing-description

The current description of representing Action parameters in the TD is too laconic and creates misunderstandings.

The text should say how is it possible/recommended to represent multiple inputs to Actions,
for instance by using an ObjectSchema.

But that would clash with representing a single parameter that is an object. How does an implementation know that an object in the TD Action input is meant as a single object parameter, or was meant as multiple parameters made from the members of the object?

Editorial ActionAffordance

Most helpful comment

The wording needs to be about the _convention_ that an Action has 0 or 1 argument, and multiple arguments are represented as properties in an object.

All 5 comments

(This issue is coming from here).

How does an implementation know that an object in the TD Action input is meant as a single object parameter, or was meant as multiple parameters made from the members of the object?

I think there is either no or one input to an action.

This action input can be of a

  • simple type (e.g., JSON schema {"type": "string"}) or it can be also a
  • composed type like object/array (e.g., { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer", "minimum": 0 } }})

OK, that would work.
Anyway that constraint needs to be stated out loud in the TD spec, maybe as a note.

This is how the JSON schema works. But you're right, it wouldn't hurt to say more words about it.

The wording needs to be about the _convention_ that an Action has 0 or 1 argument, and multiple arguments are represented as properties in an object.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

takuki picture takuki  路  5Comments

msporny picture msporny  路  8Comments

ToruKawaguchi picture ToruKawaguchi  路  6Comments

egekorkan picture egekorkan  路  3Comments

mlagally picture mlagally  路  9Comments