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

Methods of generated *_Client classes don't validate their arguments #220

Closed
dahlia opened this issue Feb 7, 2018 · 0 comments
Closed
Labels
cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python typ:bug Type: Bug/defect

Comments

@dahlia
Copy link
Member

dahlia commented Feb 7, 2018

Where we have the below interface:

service counter (
    bigint increment (bigint delta)
);

The following call doesn't raise TypeError but UnexpectedNirumResponseError:

>>> assert isinstance(client, Counter_Client)
>>> client.increment(None)
Traceback (most recent call last):
  ...
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
nirum.exc.UnexpectedNirumResponseError: ...

It even doesn't any error for an invalid type in some cases (where the argument value is homoiconic to its JSON reduction):

>>> client.increment("123")
123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python typ:bug Type: Bug/defect
Projects
None yet
Development

No branches or pull requests

1 participant