[TCGC] [Bug] TCGC should return usage as 0
for model when it is only used in protocol method's response body
#1748
Labels
lib:tcgc
Issues for @azure-tools/typespec-client-generator-core library
Issue
When a model is only used in protocol method's response body. TCGC returns the model
usage
as256
, not0
.For example, for below case,
ResourceD
is only used in protocol method's response body, but its usage is256
. WhileResourceC
which is only used in protocol method's request body, its usage is0
. I thinkResourceC
's usage is correct, butResourceD
's usage is wrong.detailed test case
Solution
When a model is used in protocol method's response body, TCGC returns the usage as
0
no matter it's input or output.The text was updated successfully, but these errors were encountered: