Fable.SimpleJson
                                
                                 Fable.SimpleJson copied to clipboard
                                
                                    Fable.SimpleJson copied to clipboard
                            
                            
                            
                        Is there an equivalent of JsonConverter in Fable.SimpleJson?
This is an example from the doc:
let person = { Name = "John"; Age = 34 }
let serialized =
    [ "name", JString person.Name
      "age", JNumber (float person.Age) ]
    |> Map.ofList
    |> JObject
    |> SimpleJson.toString
This is clear enough when I want to serialize a specific person record, but suppose I want to define how a type like Person should be serialized in general, whenever it's the value of a member like in the record below:
type MarriedCouple =
    {
        Spouse1 : Person
        Spouse2 : Person
    }
Is there any way to automatically serialize MarriedCouple using some pre-defined serialization definition for the type Person like the JsonConverters from JSON.NET or System.Text.Json?
@Zaid-Ajaj for additional context I'm asking this because I made my library FSharp.ValidationBlocks compatible with Fable and now I'm just trying to ensure the types from that library serialize correctly so the users don't have to do anything else
Hello, are there any news on this? This would be an immensely useful feature :)
Is there any way to automatically serialize MarriedCouple using some pre-defined serialization definition for the type Person like the JsonConverters from JSON.NET or System.Text.Json?
Unless I don't understand the question, this is already possible: Json.serialize will do exactly that for any given (serializable) value