You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder why you found it necessary to look for a super-type (e.g. Addressable) instead of wrapping that thing in a union type. The natural representation for the choice in that article would be something like: https://gist.github.com/alexandru/c74f15070dba2dcb4a23977633bd8815
I think it's good to reexamine earlier design decisions. If I first try to remember my thinking back then, the theme that I kept coming back to is what types represent with regard to data binding some XML document like:
<address>
<name>John</name>
</address>
If we used case class:
caseclassAddress(name: String)
then, the type String represent an xsd:type, the field name: String represent an xsd:element. Or to put another way, String represents what is in between the angle brackets <name> ... </name>.
If so, what does the case class Address represent? It also represent what is in between <address> ... </address>, and thus case class alone is not enough information to represent the whole of the XML document. It needs to be a field:
address:Address
this field is what DataRecord[A] represents. I almost want a union of literal-and-a-type pairs like:
Hello,
I have the following type described in the xsd:
This is clearly a union type. But the type generated is:
I would have expected to see something like:
Any way to prevent the use of that
DataRecord[Any]
?The text was updated successfully, but these errors were encountered: