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 55 forks source link

Question about int64 serialization #349

Closed Darkle closed 10 months ago

Darkle commented 10 months ago

Hi, I'm trying out a set up where i have fable remoting on the backend and just a regular js client consuming the fable remoting api over http. I have everything set up and working, but one thing is puzzling me: the int64's seem to be converted to strings.

Looking through the source I found this line: https://github.com/Zaid-Ajaj/Fable.Remoting/blob/master/Fable.Remoting.Json/FableConverter.fs#L401

Is this by design? Can int64's not be serialized to json properly? Does that mean I will have to manually convert each int64 string to a number on the JS side?

Thanks.

Darkle commented 10 months ago

Ok, looking at this SO post, it seems like a limitation of JSON: https://stackoverflow.com/questions/60842629/how-to-serialize-64-bit-integer-in-javascript