[typespec-autorest]: suggest removing namespace from the definition name in swagger #2055
Open
4 tasks done
Labels
emitter:autorest
Issues for @azure-tools/typespec-autorest emitter
feature
New feature or request
triaged:core
Milestone
Clear and concise description of the problem
The most common case occurs with Liftr-related services. The typespec-autorest tool prepends the namespace to model names when generating definition names in Swagger. For example:
However, for client emitters (such as C#, PowerShell, etc.), the namespace is ignored, for the example above, MarketplaceDetails will be used as the generated class name. This inconsistency will create significant challenges in the future when we transition from Swagger-based generation to typespec-based generation, as changes in definition (class) names will result in breaking changes.
I understand that the purpose of prepending the namespace is to avoid name conflicts. However, I propose the following approach:
Remove the namespace from the definition name and only prepend it when a name conflict is detected.
Checklist
The text was updated successfully, but these errors were encountered: