Azure / Azure/azure-sdk-for-cpp

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

Open
#6,335 0 comments 0 reactions 0 assignees View on GitHub
App Configuration
Dominant language
C++
Stars
205
Forks
172
Avg merge
1d 3h
Merged PRs (30d)
37

Description

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

https://github.com/Azure/azure-sdk-for-cpp/blob/53a74b02994be2fb9ecbd4fa2879ab2316dbe0a9/sdk/appconfiguration/azure-data-appconfiguration/inc/azure/data/appconfiguration/configuration_client_options.hpp#L171-L180

```diff
- 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](https://github.com/Azure/typespec-azure/issues/1757)), 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](https://datatracker.ietf.org/doc/html/rfc7089#section-2.1))?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.