typed-struct icon indicating copy to clipboard operation
typed-struct copied to clipboard

Add a `Struct.fromJSON` static method

Open akalsi87 opened this issue 1 year ago • 0 comments

  • 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.

akalsi87 avatar Oct 06 '24 16:10 akalsi87