barrister
barrister copied to clipboard
Add support for no return type
I tried to compile an IDL without any return type and it breaks:
plex.errors.UnrecognizedInput: 'None', line 3, char 16: Token not recognised in state 'type-opts'
Error loading IDL from STDIN: unexpected end of JSON input
Is it supported? If not, is there any reason to not support it? I think that empty result array is a valid response for JSONRPC request, right?
Good question. I was basing that decision on the spec (http://www.jsonrpc.org/specification#response_object) where it says:
result
This member is REQUIRED on success.
So I made function response types required on the IDL. I suppose we could send a null
value there for void functions.
I suppose that nothing prevents us from sending null
value there (I don't know what I was thinking about when I said empty array). I'll try to make the changes to support it.