typed-struct
typed-struct copied to clipboard
Add a `Struct.fromJSON` static method
-
I'm submitting a ... [ ] bug report [x] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project [ ] documentation/syntax error report
-
Summary
-
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
In certain cases, it's helpful to transport JSON and not binary. For that, the toJSON method is quite handy. However, that makes the API asymmetric, such that I can easily convert to JSON but cannot trivially convert back into a typed struct.
Request: Add a Struct.fromJSON static method.