Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DateOnly support to XmlSerializer #7126

Open
sliekens opened this issue Jul 30, 2024 · 1 comment
Open

Add DateOnly support to XmlSerializer #7126

sliekens opened this issue Jul 30, 2024 · 1 comment
Labels

Comments

@sliekens
Copy link

sliekens commented Jul 30, 2024

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:

throw new Exception($"Type not supported by the serializer: {type.AssemblyQualifiedName}");

Describe the requested feature

Serialize DateOnly to yyyy-MM-dd

Describe alternatives you've considered

  • Migrate to JSON messages, but that is a larger effort, doesn't make sense in my current environment, maybe later
  • Use DateTime, but time zones scare me
  • Use string and parse the DateOnly myself, thanks but no thanks

Additional Context

No response

@jpalac
Copy link
Contributor

jpalac commented Jul 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants