Skip to content

[Bug]: TCGC getClientNameOverride returns an object (instead of string or null) #699

@weidongxu-microsoft

Description

@weidongxu-microsoft

Describe the bug

export declare function getClientNameOverride(context: TCGCContext, entity: Type): string | undefined;

but it returns an object when the issue happens
image

Reproduction

loadtesting
https://github.com/Azure/azure-rest-api-specs-pr/blob/c4b80c74909bf593825e29ce7ff459decba35efd/specification/loadtestservice/LoadTestService/tspconfig.yaml

PR https://github.com/Azure/azure-rest-api-specs-pr/pull/17749

operation is

createOrUpdateTest is StandardResourceOperations.ResourceCreateOrUpdate<Test>;

they also have a

@@clientName(Azure.Core.Foundations.ResourceBody.resource, "body");

in routes.tsp, not sure if related.

call to getClientNameOverride is on the ModelProperty of the Test model.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions