What if a block doesn't have any output?
For example, the send email block doesn't have any output. I vote we send a 2xx and an empty response body.
{ "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
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.
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
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.