autorest.typescript icon indicating copy to clipboard operation
autorest.typescript copied to clipboard

Unexpected property value is generated in MPG sample generation if it is a union enum

Open kazrael2119 opened this issue 4 months ago • 0 comments

If a property value is a union enum like:


interface xxx {
    method: DataLakeStorageAuthMethod;
}

/** Alias for DataLakeStorageAuthMethod */
export type DataLakeStorageAuthMethod =
  | ManagedIdentityMethod
  | AccessTokenMethod;

sample will generate the relative properties as :

xxx : {
            method: AccessToken,
          },

expected value:

xxx : {
            method: "AccessToken",

          },

tsp link: https://github.com/Azure/azure-rest-api-specs/blob/7507aafa42d29e3526d8e5aacf6233c0e9a959d0/specification/iotoperations/IoTOperations.Management/models/dataflows/dataflowEndpoints.tsp#L140-L146

kazrael2119 avatar Oct 23 '24 09:10 kazrael2119