FSharp.Data
FSharp.Data copied to clipboard
XmlProvider has XElement on every node but this means I can't serialize the type
The type that XmlProvider
generates has an XElement
property on every node, but this means I can't serialize it.
I am using Bolero and want to create a remote service where some of the function arguments are types generated by XmlProvider
. Bolero automatically generates serialization code for RPC, but it complains saying:
No JSON encoding for System.Xml.Linq.XElement
Is there a workaround?
You cannot really map 1:1 in between XML and JSON since XML has more concepts (e.g. attributes). That said, the documentation includes a page on that: https://fsprojects.github.io/FSharp.Data/tutorials/JsonToXml.html