Skip to content

[http-client-csharp] Change the way of caching models #7758

Open
@ArcturusZhang

Description

@ArcturusZhang

Currently our emitter is caching models and enums by their names.
This is incorrect - because they might have different namespaces. In typespec, you could define models with the same name in different namespaces.
Our current emitter behavior is that if this case happens, these two models will be collapsed to one model with that name - all the places that referenced to either of these models will be changed to the collapsed model.
In most cases, this is wrong and we should fix it.

This has an impact in autorest.csharp because for azure libraries, every model is generated into one big namespace, if we have types with the same name, they will be generated into multiple classes with the same name which cannot compile at all.
But there is always a workaround or solution for that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions