-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Description
The following XSD generates a string representation for Date/DateTime:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0.48448">
<xs:simpleType name="SnapshotDate">
<xs:restriction base="xs:date" />
</xs:simpleType>
<xs:simpleType name="SnapshotDateTime">
<xs:restriction base="xs:dateTime" />
</xs:simpleType>
<xs:element name="Snapshot">
<xs:complexType>
<xs:attribute name="Date" use="required">
<xs:simpleType>
<xs:union memberTypes="SnapshotDate SnapshotDateTime" />
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
It would be ideal if this used either the OneOf nuget package to handle the union directly, or did clever inference to infer date and dateTime are both the same .NET data type (except if on .NET 6 and DateOnly is supported). For backwards compatibility reasons, I'd rather the generator not use DateOnly, as I still rely on your tool for .NET Framework apps until for at least another 6-12 months.
Metadata
Metadata
Assignees
Labels
No labels