-
Notifications
You must be signed in to change notification settings - Fork 790
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
RPC callback block field is a string and not an object #749
Comments
Same applies for retrieving a block over the RPC. This results in bad code on the listener side when using automatic JSON to object mapping. Simple Kotlin example with json_response being the body of the result of the rpc call and jacksonObjectMapper some json mapping library:
|
I believe it's a string because that's the format that the RPC Edit: Which, in turn, I believe is because boost json parsing is buggy/questionable or something like that. Don't know all the details. |
Yea we need to swap out the Jason serialization library or if someone wants to contribute that. |
I'm closing this ticket as a duplicate of #499 so that we can track the specific needed changes individually. |
Description of bug:
The RPC callback does send the block field as a string. So for example:
In the wiki it is shown as JSON-object. So the same example should be like this:
I like approach using JSON-objects seems more like what one would expect in my opinion. Is there a specific reason for it being a string? If not what about changing it to return an object by default while still being able to use the "legacy" mode for backwards compatibility by setting something in the config?
The text was updated successfully, but these errors were encountered: