Proposal: use TD `default` values
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 45
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
hello,
I'd like to propose the scripting API to define variables the consumer leaves undefined with the default values from the TD (or const values?).
A simple use-case would be a Thing, expecting a fixed payload parameter based on the Interaction Affordance, like in the TD below.
Now with the scripting API using the default values a user won't have to worry about knowing the correct commandId.
{
"actions": {
"move": {
"type": "object",
"properties": {
"commandId": {
"type": "integer",
"default": 5
},
// other dynamic properties like coordinates
}
},
"dimLight": {
"type": "object",
"properties": {
"commandId": {
"type": "integer",
"default": 6
}
// other dynamic properties like time span
}
}
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the scripting API path that builds action payloads from a Thing Description, then determine how omitted variables and TD default or const values should be handled. Done should include a decided behavior for the commandId example and tests covering omitted values; the issue names no files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100