-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transferring private types #348
Comments
Hi there @DejanMilicic I haven't tested what the binary serialization does to private fields, maybe you could try that and see if it fixes the problem? Otherwise I don't think there is a way to do this right now with Newtonsoft.Json 🤔 |
Hi! came here with the same problem as @DejanMilicic. Just wanted to confirm that turning on binary serialization does indeed fix the issue. Thanks @Zaid-Ajaj |
Hi @DejanMilicic, a quick note to say that private discriminated unions are successfully transferred. I.e., module DateRange =
type T = private T of {
StartDate : Option<DateTime>
EndDate : Option<DateTime>
} I'm not sure whether this is by design, or by accident. One upshot is that constrained types coming from the JS front end don't get constructed with the proper constructor, which leaves you vulnerable to exploits, since the JSON can contain illegal values, which are placed in your constrained type during deserialisation. We have toyed with the idea of implementing a Roland |
I have a type that looks like this:
When making Fable.Remoting calls, NewtonSoft.Json complains that there is not public constructor exposed.
Removing
private
is a quick fix.However, is there any other way I could resolve this without exposing properties of the type? E.g. would switching to some other serialization method work? What would be your recommendation in this case?
The text was updated successfully, but these errors were encountered: