Azure / Azure/azure-sdk-for-cpp
List of typespec modifications needed in client.tsp for AppConfig to generate expected models for C++
- Dominant language
- C++
- Stars
- 205
- Forks
- 172
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 37
Description
Capturing the set of model feedback for the generated code based on the AppConfig tsp:
https://github.com/Azure/azure-sdk-for-cpp/pull/6176
- [ ] Key is an *incredibly* generic type name, how certain are you that it is unique? [link](https://github.com/Azure/azure-sdk-for-cpp/pull/6176#discussion_r1829833431)
```C++
struct Key final
```
- [ ] Why is this not a Key? [link](https://github.com/Azure/azure-sdk-for-cpp/pull/6176#discussion_r1829833962)
```C++
struct KeyValue final
{
std::string Key;
```
The tsp defines it as string
https://github.com/Azure/azure-rest-api-specs/blob/7dfd17073198d5cf3df99a106b770cb01b395f2a/specification/appconfiguration/AppConfiguration/models.tsp#L169-L175
- [ ] Why is this not an ETag? [link](https://github.com/Azure/azure-sdk-for-cpp/pull/6176#discussion_r1829834287)
```C++
struct CheckKeyValuesResult final
{
std::string SyncToken;
std::string ETag;
```
It's specified as string in the typespec. We'd need to override it in a `client.tsp` file to match the expected model we want.
https://github.com/Azure/azure-rest-api-specs/blob/7dfd17073198d5cf3df99a106b770cb01b395f2a/specification/appconfiguration/AppConfiguration/models.tsp#L161-L162
- [ ] This needs to be Nullable - it is not guaranteed to be present. [link](https://github.com/Azure/azure-sdk-for-cpp/pull/6176#discussion_r1829835203)
```C++
struct GetKeyValueResult final
{
Core::Uuid XMsClientRequestId{};
std::string SyncToken;
```
It isn't marked as optional in the tsp:
https://github.com/Azure/azure-rest-api-specs/blob/7dfd17073198d5cf3df99a106b770cb01b395f2a/specification/appconfiguration/AppConfiguration/routes.tsp#L302-L306
- [ ] Why aren't SyncToken Nullable [link](https://github.com/Azure/azure-sdk-for-cpp/pull/6176#discussion_r1829835630)
```C++
Core::Uuid XMsClientRequestId{};
std::string SyncToken;
```
This might be an emitter issue, since the syncTokenHeader model contains an optional string in the tsp:
https://github.com/Azure/azure-rest-api-specs/blob/7dfd17073198d5cf3df99a106b770cb01b395f2a/specification/appconfiguration/AppConfiguration/routes.tsp#L29-L33
This list isn't exhaustive but using it to track the set of changes we'd want to make
Contributor guide
Assessment
This issue has not been assessed yet.