I do stuff like this:
type LocalPath = private LocalPath of string
with
static member make (path: string) =
if path.Contains ".."
then failwith "String contains .."
else LocalPath path
member this.serialized =
let (LocalPath path) = this
path
module LocalPath =
let (|LocalPath|) = fun (LocalPath f) -> f
This gets deserialized through reflection even though the constructor is marked private.
It would be nice to be able to disable this behavior so that it can be used viably as added security.
The current workaround is to use a custom JsonConverter and not let Fsharp.STJ unwrap anything.
I do stuff like this:
This gets deserialized through reflection even though the constructor is marked private.
It would be nice to be able to disable this behavior so that it can be used viably as added security.
The current workaround is to use a custom JsonConverter and not let Fsharp.STJ unwrap anything.