Skip to content

[Bug]: Anonymous unions in models referenced in union/@event decorator don't get generated name #4129

@MaiLinhP

Description

@MaiLinhP

Describe the bug

When upgrading OpenAI repo to new TCGC version, we're getting an issue where the same anonymous unions in different models are not getting generated names but collapse into an unnamed type, causing duplicate client name error. These seem to happen to unions in models referenced in other unions/@event decorator

Reproduction

Example 1
Example 2

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

bugSomething isn't workinglib:tcgcIssues for @azure-tools/typespec-client-generator-core library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions