FSharp.Data icon indicating copy to clipboard operation
FSharp.Data copied to clipboard

XmlProvider has XElement on every node but this means I can't serialize the type

Open Bananas-Are-Yellow opened this issue 4 years ago • 1 comments

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?

Bananas-Are-Yellow avatar Jun 23 '20 08:06 Bananas-Are-Yellow

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

OscarAblinger avatar Mar 11 '21 17:03 OscarAblinger