Skip to content

List of typespec modifications needed in client.tsp for AppConfig to generate expected models for C++ #6183

@ahsonkhan

Description

@ahsonkhan

Capturing the set of model feedback for the generated code based on the AppConfig tsp:
#6176

  • Key is an incredibly generic type name, how certain are you that it is unique? link
struct Key final
  • Why is this not a Key? link
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
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
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
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    App ConfigurationAzure.ApplicationModel.Configuration

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions