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

Use the alternateType decorator to change the acceptDateTime field from string to utcDateTime so it is emitted as an RFC 1123 Azure::DateTime #6335

Open
ahsonkhan opened this issue Jan 13, 2025 · 0 comments
Assignees
Labels
App Configuration Azure.ApplicationModel.Configuration

Comments

@ahsonkhan
Copy link
Contributor

ahsonkhan commented Jan 13, 2025

https://github.com/Azure/azure-rest-api-specs/blob/9cda51602860201954415dab20bdcbcf389c7da9/specification/appconfiguration/AppConfiguration/routes.tsp#L684-L685

struct GetLabelsOptions final
{
std::string NextPageToken;
std::string Name;
std::string SyncToken;
std::string After;
std::string AcceptDatetime;
std::vector<LabelFields> Select;
Core::Uuid XMsClientRequestId{};
};

- std::string AcceptDatetime; 
+ Azure::DateTime AcceptDatetime;

Once we have the ability to modify types in TypeSpec ([TCGC] Add @alternateType to change the type of a property (with scope) · Issue #1757 · Azure/typespec-azure), start with isolating the change to just the client.tsp scoped to C++ and verify the generated code works as expected. In the future, if it can be generally accepted across all language SDKs without impacting customers of the SDKs, we can consider moving it to the main routes.tsp common across all languages.

The AppConfig service officially only document RFC 1123 format support. Service ignores this header if the value is not in the right format:
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-labels?pivots=v23-10#time-based-access

From the service team, it is safe to assume that the only valid supported format here is an RFC 1123 date time (from the spec linked in the API docs HTTP Framework for Time-Based Access to Resource States)?

@ahsonkhan ahsonkhan added the App Configuration Azure.ApplicationModel.Configuration label Jan 13, 2025
@ahsonkhan ahsonkhan self-assigned this Jan 13, 2025
@ahsonkhan ahsonkhan changed the title Use the alternateType decorator toe change the acceptDateTime field from string to offsetDateTime so it is emitted as an RFC 1123 Azure.Core.DateTime Use the alternateType decorator to change the acceptDateTime field from string to offsetDateTime so it is emitted as an RFC 1123 Azure.Core.DateTime Jan 13, 2025
@ahsonkhan ahsonkhan changed the title Use the alternateType decorator to change the acceptDateTime field from string to offsetDateTime so it is emitted as an RFC 1123 Azure.Core.DateTime Use the alternateType decorator to change the acceptDateTime field from string to utcDateTime so it is emitted as an RFC 1123 Azure::DateTime Jan 14, 2025
@RickWinter RickWinter added Azure.Identity and removed App Configuration Azure.ApplicationModel.Configuration labels Jan 24, 2025
@RickWinter RickWinter added App Configuration Azure.ApplicationModel.Configuration and removed Azure.Identity labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration
Projects
None yet
Development

No branches or pull requests

3 participants