spec icon indicating copy to clipboard operation
spec copied to clipboard

What if a block doesn't have any output?

Open matthewhudson opened this issue 13 years ago • 4 comments

For example, the send email block doesn't have any output. I vote we send a 2xx and an empty response body.

matthewhudson avatar Dec 03 '12 02:12 matthewhudson

{ "result": null, "error": null}

Maybe?

On Sun, Dec 2, 2012 at 6:56 PM, Matthew Hudson [email protected]:

For example, the send email block doesn't have any output. I vote we send a 2xx and an empty response body.

— Reply to this email directly or view it on GitHubhttps://github.com/webpipes/spec/issues/7.

Jeff Lindsay http://progrium.com

progrium avatar Dec 03 '12 02:12 progrium

Probably best to return an empty object for consistency and to signal "success". It functions just like other blocks, it just happens to have no outputs.

I was also considering whether the email block should have an output, maybe called "success", but I guess that's implicit in the block returning the empty object. Maybe some pipeline variants could have success/error outputs that you could pipe to other blocks.

Also I'd leave the error property off unless there's actually an error.

tlrobinson avatar Dec 03 '12 09:12 tlrobinson

Wouldn't success be implied by the Status Code? Although, if we're moving the direction of JSONRPC and multi transport, then HTTP Status Codes are off the table to signal success or failure.

Thanks, Matthew Hudson

matthewhudson avatar Dec 03 '12 09:12 matthewhudson

True, the status code should imply success.

Since it's called WebPipes I don't think we should avoid using HTTP features for the sake of other transports. We can always just tack on status codes and headers to the request/response objects when using other transports, etc.

tlrobinson avatar Dec 03 '12 09:12 tlrobinson