core
core copied to clipboard
implement ToJson/FromJson traits for types defined in core
- [x] float
- [x] fixedarray
- [x] bigint
- [x] byte
- [ ] bytes
- [x] option
- [x] result
- [x] unit
Should byte and bytes be base64 encoded string in json? @bobzhang @Yoorkin This is what protobuf does.
ref:
| bytes | base64 string | "YWJjMTIzIT8kKiYoKSctPUB+" | JSON value will be the data encoded as a string using standard base64 encoding with paddings. Either standard or URL-safe base64 encoding with/without paddings are accepted. |
|---|
I think bytes should encoded as byte[], which byte is number of 0-255.