diff --git a/packages/typespec-autorest/src/openapi.ts b/packages/typespec-autorest/src/openapi.ts index 73450bca0d..6ff51569a0 100644 --- a/packages/typespec-autorest/src/openapi.ts +++ b/packages/typespec-autorest/src/openapi.ts @@ -1030,7 +1030,7 @@ export async function getOpenAPIForService( const encodedName = resolveEncodedName(program, type, "application/json"); // Pick the value set via `encodedName` or default back to the legacy projection otherwise. // `resolveEncodedName` will return the original name if no @encodedName so we have to do that check - return encodedName === type.name ? viaProjection ?? type.name : encodedName; + return encodedName === type.name ? (viaProjection ?? type.name) : encodedName; } function emitEndpointParameters(methodParams: HttpOperationParameters, visibility: Visibility) {