core icon indicating copy to clipboard operation
core copied to clipboard

implement ToJson/FromJson traits for types defined in core

Open Yoorkin opened this issue 1 year ago • 2 comments

Yoorkin avatar Sep 11 '24 08:09 Yoorkin

  • [x] float
  • [x] fixedarray
  • [x] bigint
  • [x] byte
  • [ ] bytes
  • [x] option
  • [x] result
  • [x] unit

qazxcdswe123 avatar Sep 11 '24 08:09 qazxcdswe123

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.

qazxcdswe123 avatar Sep 11 '24 09:09 qazxcdswe123

I think bytes should encoded as byte[], which byte is number of 0-255.

hackwaly avatar May 29 '25 07:05 hackwaly