Add some missing methods to the types in datetime#25826
Merged
jhendrixMSFT merged 8 commits intoAzure:mainfrom Jan 12, 2026
Merged
Add some missing methods to the types in datetime#25826jhendrixMSFT merged 8 commits intoAzure:mainfrom
jhendrixMSFT merged 8 commits intoAzure:mainfrom
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the datetime package by adding missing text marshalers/unmarshalers to ensure all datetime types have consistent serialization support, and improves robustness by handling JSON null values in unmarshalers. It also cleans up documentation by adding missing punctuation to doc comments.
Key Changes
- Added
MarshalTextandUnmarshalTextmethods toUnixandPlainDatetypes for consistency with other datetime types - Implemented JSON null handling across all
UnmarshalJSONmethods to prevent errors when deserializing null values - Fixed missing periods in doc comments for
String,MarshalText, andUnmarshalTextmethods across multiple types
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/azcore/runtime/datetime/unix.go | Added text marshaling methods, null handling, and refactored parsing logic into a shared helper function |
| sdk/azcore/runtime/datetime/unix_test.go | Added comprehensive tests for new text marshaling methods and null handling |
| sdk/azcore/runtime/datetime/plain_date.go | Added text marshaling methods, introduced jsonNull constant, and null handling in UnmarshalJSON |
| sdk/azcore/runtime/datetime/plain_date_test.go | Added tests for text marshaling methods and null/empty input handling |
| sdk/azcore/runtime/datetime/plain_time.go | Added null handling in UnmarshalJSON and fixed doc comment punctuation |
| sdk/azcore/runtime/datetime/plain_time_test.go | Added tests for null and empty input handling |
| sdk/azcore/runtime/datetime/RFC3339.go | Added null handling in UnmarshalJSON and fixed doc comment punctuation |
| sdk/azcore/runtime/datetime/RFC3339_test.go | Replaced generic test with focused null handling test |
| sdk/azcore/runtime/datetime/RFC1123.go | Added null handling in UnmarshalJSON and fixed doc comment punctuation |
| sdk/azcore/runtime/datetime/RFC1123_test.go | Added test for JSON null handling |
chlowell
reviewed
Jan 6, 2026
RickWinter
reviewed
Jan 6, 2026
3ee1a22 to
f4f3ccd
Compare
chlowell
reviewed
Jan 8, 2026
gracewilcox
reviewed
Jan 8, 2026
Added missing text (un)marshalers on some types so they're all uniform. Handle JSON nulls in JSON unmarshalers. Cleaned up some missing punctuation in doc comments.
716cb70 to
2086a8e
Compare
chlowell
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added missing text (un)marshalers on some types so they're all uniform.
Handle JSON nulls in JSON unmarshalers.Cleaned up some missing punctuation in doc comments.