Skip to content
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

Add support for no return type #14

Open
colega opened this issue Mar 15, 2018 · 2 comments
Open

Add support for no return type #14

colega opened this issue Mar 15, 2018 · 2 comments

Comments

@colega
Copy link

colega commented Mar 15, 2018

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?

@coopernurse
Copy link
Owner

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.

@colega
Copy link
Author

colega commented Mar 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants