Skip to content

allow null as well as '{}' for empty objects in json - #62

Open
kryton wants to merge 1 commit into
EOSIO:masterfrom
kryton:null_variant
Open

allow null as well as '{}' for empty objects in json#62
kryton wants to merge 1 commit into
EOSIO:masterfrom
kryton:null_variant

Conversation

@kryton

@kryton kryton commented Jun 11, 2020

Copy link
Copy Markdown

certain json parsers (serde_json in rust) convert no-field empty structs as null, instead of '{}'.
This patch allows for both ways to seen as valid.
(for example)
["get_status_request_v0",null]
as well as
["get_status_request_v0",{}]

@kryton

kryton commented Jun 11, 2020

Copy link
Copy Markdown
Author

NB:.. serde_json still won't fully work with variants.
as it converts 'enums' as objects, not arrays..
eg
{"get_status_request_v0":null}
is what it would generate
that's a non-compatible change .. so won't be submitting a PR for that bit

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.

1 participant