-
Notifications
You must be signed in to change notification settings - Fork 80
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
InteractionOutput.value() throws an error for Actions with no output DataSchema #1228
Comments
We could look whether a schema is available at all
Hence, we should not do anything if |
I created draft PR #1230 to show what I mean... |
Throwing an error if |
Related to w3c/wot-scripting-api#534 |
I think this is also related to satellite discussions: w3c/wot-thing-description#1234 and in particular w3c/wot-thing-description#1441. My opinion here is that the implementation is still correct, but we are lacking a way to clearly express the fact that we are expecting an empty payload. |
I encountered this problem while interacting with the TestThing. When invoking the
"void-void"
action, the action results in an505: Internal Server Error
with the messageNo schema defined
. This is thrown insidevalue()
as seen below:node-wot/packages/examples/src/testthing/testthing.ts
Line 240 in 82f7f7a
As no data schema is needed for an action with no output, calling
value()
on the interaction output throws an error. However, this behavior seems a little counterintuitive. I would think, intuitively, that an action without anoutput
DataSchema
would either provide noInteractionOutput
at all or would provide andInteractionOutput
with avalue()
method that resolves withundefined
and anarrayBuffer()
method that resolves with an empty array (maybe alsoundefined
but it makes more sense you would actually get an array, but it's empty because there is no output).The text was updated successfully, but these errors were encountered: