Skip to content

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

Description

@ahsonkhan

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)?

Metadata

Metadata

Assignees

Labels

App ConfigurationAzure.ApplicationModel.Configuration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions