-
Notifications
You must be signed in to change notification settings - Fork 28
WoT.consume(USVString url) sufficient for consuming things? #69
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
Comments
We could theoretically split the
Alternatively, we could have a combined argument type: typedef (ThingInit or USVString) ThingSource;
Promise<ConsumedThing> consume(ThingSource source); then we could say or
or wot.consume({
contentType: "application.json",
description: "{ \
// here come the TD specified e.g. as JSON \
}"
}).then((thing) => { ... });` where |
I like the idea of separating the processing steps to The only "update" to your proposal for me would be changing the signature of consume to
We don't know yet what |
When splitting, why not revert to |
It was a lengthy discussion. The "pro" argument for splitting to The "con" arg would be that WoT fetch may be so different from the Fetch standard that the name would just create more confusion. This is a "social" hypothesis and needs to be checked before we base API decisions on it. But even if it's valid we could use |
I still think having a 2 step approach to consume a TD makes sense. Step1 (optional), fetching a TD might involve protocol bindings based on an URL such as retrieving a TD from an Step2, actually consuming a TD based on a ThingDescription "object/representation" is straight forward. Step2 is required and does not restrict "where" the TD comes from... |
Addressed by #86. |
WoT used to have methods to consume ThingDescriptions based on a given URL but also based on a stringified JSON (object). The latter one has been removed.
Hence,
'data:application/json;charset=utf-8, ...'
)The only down-side I see with these solutions is that implementations need to have protocol support for http, file, data, ... while a plain string processing is supported out-of-the-box.
The text was updated successfully, but these errors were encountered: