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

mqtt-rpc-client: fix default value of --args option #13

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

sikmir
Copy link
Contributor

@sikmir sikmir commented Jan 24, 2024

Многие RPC методы не имеют параметров, но сейчас если не передать явно пустой объект -a '{}', то в запросе будет "params": null, хотя согласно описанию формально там должно быть "JSON-объект или массив значений", но не null.
Некоторые сервисы тем не менее понимают null в params:

mqtt-rpc-client -d wb-mqtt-serial -s ports -m Load
[{"baud_rate": 115200, "data_bits": 8, "parity": "N", "path": "/dev/ttyRS485-1", "stop_bits": 2}, {"baud_rate": 9600, "data_bits": 8, "parity": "N", "path": "/dev/ttyRS485-2", "stop_bits": 2}]

Но некоторые не понимают:

mqtt-rpc-client -d confed -s Editor -m List
Error: Invalid params [-32602]: None

@sikmir sikmir requested a review from a team January 24, 2024 22:07
@sikmir sikmir merged commit ab40b9e into main Jan 25, 2024
9 checks passed
@sikmir sikmir deleted the feature/fix-default-args branch January 25, 2024 07:45
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

Successfully merging this pull request may close these issues.

2 participants