Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 54 forks source link

Fix byte serialization in MsgPack #258

Closed kerams closed 3 years ago

kerams commented 3 years ago

Fixes #257.

@Zaid-Ajaj, I've discovered a problem with JSON SByte serialization though. The echo response is {"Byte":200,"Maybes":[{"Just":-120},"Nothing",{"Just":120},{"Just":5},{"Just":-5}],"SByte":-10}, which looks correct, but deserialization fails with Cannot convert -120 to System.SByte.

type OtherDataC = {
    Byte: byte
    Maybes: Maybe<sbyte> list
    SByte: sbyte
}

let input = {
    Byte = 200uy
    SByte = -10y
    Maybes = [ Just -120y; Nothing; Just 120y; Just 5y; Just -5y ]
}

Could be something in SimpleJson?

Zaid-Ajaj commented 3 years ago

The problem was indeed in SimpleJson. Just fixed it and published a new package v3.21 which should support sbyte types.

Can you try updating SimpleJson here when it becomes available? Then I can merge this and publish the goodies :smile:

kerams commented 3 years ago

Good stuff, we have liftoff.

Zaid-Ajaj commented 3 years ago

Published a new batch 🚀