You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would you expect raw bytes to be encoded in JSON?
Base64 String? Simple hex string? As an array of JSON numbers?
IMHO there is no clear and valuable default strategy here, or is there?
@sirthias I agree that there is no natural default. But getting a runtime error is not nice.
For us, any default will work because we will rarely exercise this path when using the REST/Json.
I would suggest we go ahead with Encoder.forArray[Byte] as the default because that is what most JSON libs do.
Also, in this case encoder, we do not need to define the decoder, and the following works fine: Json.decode(Json.encode("abc".getBytes()).toByteArray).to[Array[Byte]].value
Test
Error
Related
All of the following works
Workaround
We had to write an analogous target specific decoder for Array[Bytes]
The text was updated successfully, but these errors were encountered: