microsoft / microsoft/typespec

Wrong type ouput for `getEffectiveModelType`

Open
#2,991 11 comments 0 reactions 0 assignees View on GitHub
triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

For the following TypeSpec, when we call `getEffectiveModelType` for type `Product`, we will get a type named `ProxyResource` with the same properties of the original type `Product`. I suppose it should return the original type of `Product`.
```
model Product is ProxyResource {
@doc("Name of product.")
@pattern("^[\\w][\\w\\s]{1,48}[\\w]$|^\\.default$|^\\.unassigned$")
@key("productName")
@path
@segment("products")
name: string;
}
```

This output may impact many things, include the output of `getLroMetadata` for Azure: https://github.com/Azure/typespec-azure/issues/311.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.