Particular / NServiceBus

Build, version, and monitor better microservices with the most powerful service platform for .NET
https://particular.net/nservicebus/
Other
2.08k stars 648 forks source link

Add DateOnly support to XmlSerializer #7126

Open sliekens opened 1 month ago

sliekens commented 1 month ago

Describe the feature.

Add the ability to serialize DateOnly (and TimeOnly) to and from XML.

Is your feature related to a problem? Please describe.

The XmlSerializer will happily write DateOnly to XML by calling ToString() (not an ISO format).

The receiving end then crashes with an exception:

image

Thrown from this code: https://github.com/Particular/NServiceBus/blob/16511c5f32a36f6c128324abfdfd6a2bfb871ca3/src/NServiceBus.Core/Serializers/XML/XmlDeserialization.cs#L490

Describe the requested feature

Serialize DateOnly to yyyy-MM-dd

Describe alternatives you've considered

Additional Context

No response

jpalac commented 1 month ago

Thank you for submitting the feature request - we will consider it in a future platform enhancement release. In the meantime, we have updated our documentation to reflect that DateOnly is currently not supported.