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

If an API method returns 'null' it is interpreted as a success by API renderers. #6368

Closed
diosmosis opened this issue Oct 2, 2014 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@diosmosis
Copy link
Member

API methods that return 'null' explicitly are rendered as {result: 'ok', message: 'success'} by API renderers, which I believe is incorrect.

@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Oct 2, 2014
@mattab
Copy link
Member

mattab commented Oct 2, 2014

  • When there is no return value we assume success response.
  • I think we cannot differentiate between return null; and when there is no returned value.
  • that's why return null; appears as success.

I would propose instead to modify the return null; and instead return false or some other meaningful return value?

@diosmosis
Copy link
Member Author

Returning array('value' => null) appears to work. Closing.

@diosmosis diosmosis added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Oct 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants