-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uriVariables needs to be more limited #1068
Comments
Another thing that is confusing about "configure":{
"title": "configure",
"description": "",
"input": {
"title": "payload",
"type": "object",
"properties": {
/**/
}
},
"uriVariables": {
"id":{
"type": "string"
}
},
"output": {},
"forms": [{
"href": "http://example.com/subdevice{?id}"
}]
} Essentially we could simplify the affordance like this: "configure":{
"title": "configure",
"description": "",
"input": {
"title": "payload",
"type": "object",
"properties": {
"id": {
"type": "string"
}
/**/
}
},
"output": {},
"forms": [{
"href": "http://example.com/subdevice{?id}"
}]
} A runtime just needs to know which property of the input should be inserted in the URI. Conflicts between the payload and the URI template can be easily resolved by using a different name. Regarding other interaction affordances (i.e., properties and events), having |
The main use case I find for
|
Yes! exactly. What I would like to see on the document is an explainer saying that: "retrofitting an existing API might need the usage of Edit: |
@relu91 I think your second example above has some copy-paste artifact left in there. I guess uriVariables in the second example should not be there? Regarding modeling it as an action, I think that it does not make sense from an interaction modeling point of view. Here, a data is simply being retrieved and retrieving it does not cause any changes in the system. I think the 3rd option used by Accuweather is the most logical one and uses REST principles better. |
Nice catch! updated.
Yes, I agree Accuweather seems more reasonable from a REST point of view and that's maybe why we should keep Regarding the fact that action must change something in the system, I think it from the earlier definition of a Web Thing. Reading from the architecture a Web Thing can now be an virtual entity and a action has less strict definition:
As I interpret it, it seems that I am also allowed to think of actions as processes or logical operations that a Thing can do. In our experiments, we usually follow the OOP rule of thumb, so if I property getter needs inputs then it's actually an action. Furthermore, if something is logically a long-running process then starts when invoked and can be named as a verb then it's an action. For example, a Back to the API that you posted, I know that here we are really talking about details but taking as an example openweather you might even think it as if there's a collection of weather forecasts and you are selecting the city. Consequently, it could be seen as if you are filtreing / processing it to retrive the requested information -> an Action. |
In the call of 12.05, we have decided to close this issue but open a new one at: #1138 |
uriVariables
should only typed with simple data types such as string and number. Complex types like arrays and object should not allowed. We need an assertion about this.The text was updated successfully, but these errors were encountered: