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

Do not convert dates #1986

Merged
merged 3 commits into from
Jan 10, 2025
Merged

Do not convert dates #1986

merged 3 commits into from
Jan 10, 2025

Conversation

heaths
Copy link
Member

@heaths heaths commented Jan 9, 2025

Technically, we weren't because we weren't capturing the return of to_offset(), but this cleans up the code and adds some tests that caused us to miss this.

Resolves #1982

This also renames RFC 1123 functions to 7231, which obsolesces 1123 effectively; though, is itself obsolesced by 9110. We do refer to 7231 in both TypeSpec and REST API Guidelines already, though.

@heaths heaths requested a review from RickWinter as a code owner January 9, 2025 23:36
@heaths heaths requested a review from jhendrixMSFT January 9, 2025 23:36
@heaths heaths requested a review from ronniegeraghty as a code owner January 9, 2025 23:36
@heaths heaths requested a review from RickWinter January 9, 2025 23:36
@heaths heaths requested a review from LarryOsterman as a code owner January 9, 2025 23:36
@heaths heaths requested a review from LarryOsterman January 9, 2025 23:36
@heaths
Copy link
Member Author

heaths commented Jan 10, 2025

@JeffreyRichter can you have a look as well?

Copy link
Member

@JeffreyRichter JeffreyRichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from 1123 to 7231 now is fine. But of course, we can't chase RFC numbers as the years go on.

@heaths
Copy link
Member Author

heaths commented Jan 10, 2025

Switching from 1123 to 7231 now is fine. But of course, we can't chase RFC numbers as the years go on.

Agreed. And given TypeSpec documents "rfc7231" as a supported @encode parameter, I'd say it's locked in within reason. If we ever do update our REST API Guidelines, we should probably retain some reference to 7231 e.g., "dates must comply with RFC 9110 (replaces RFC 7231)...". Keeps things orderly and more references more discoverable.

Technically, we weren't because we weren't capturing the return of `to_offset()`, but this cleans up the code and adds some tests that caused us to miss this.

Relates to Azure#1982
@heaths heaths disabled auto-merge January 10, 2025 20:02
@heaths heaths merged commit 9639a22 into Azure:main Jan 10, 2025
13 checks passed
@heaths heaths deleted the dates branch January 10, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TypeSpec] Date-time parsing assumes UTC format
3 participants