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 and TimeOnly literal converters #282

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

brantburnett
Copy link
Contributor

Motivation

We'd like to add support for DateOnly and TimeOnly when targeting modern .NET and using System.Text.Json. When we do, we'll need support for header and query string literals as well.

Modifications

  • Add DateOnlyLiteralConverter and TimeOnlyLiteralConverter, mirroring the serialization formats used by System.Text.Json
  • Register on LiteralConverterRegistry

Results

No changes for now unless an extension is used to change schema generation to use DateOnly and TimeOnly.

Motivation
----------
We'd like to add support for DateOnly and TimeOnly when targeting
modern .NET and using System.Text.Json. When we do, we'll need support
for header and query string literals as well.

Modifications
-------------
- Add DateOnlyLiteralConverter and TimeOnlyLiteralConverter, mirroring
  the serialization formats used by System.Text.Json
- Register on LiteralConverterRegistry

Results
-------
No changes for now unless an extension is used to change schema
generation to use DateOnly and TimeOnly.
@brantburnett
Copy link
Contributor Author

/merge

@centeredgebot centeredgebot bot merged commit 7c418a4 into main Feb 1, 2025
11 checks passed
@centeredgebot centeredgebot bot deleted the date-time-only-literal-converters branch February 1, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant