Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[TCGC][Bug] TCGC SdkModelType.usage does not consider readonly case #916

Closed
Tracked by #2665 ...
haolingdong-msft opened this issue May 24, 2024 · 0 comments · Fixed by #935
Closed
Tracked by #2665 ...

[TCGC][Bug] TCGC SdkModelType.usage does not consider readonly case #916

haolingdong-msft opened this issue May 24, 2024 · 0 comments · Fixed by #935
Assignees
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@haolingdong-msft
Copy link
Member

TSP:

  model ResultModel {
    name: string;
  }

  model RoundTripModel {
    @visibility("read")
    result: ResultModel;
  }

  @route("/modelInReadOnlyProperty")
  @put
  op modelInReadOnlyProperty(@body body: RoundTripModel): {
    @body body: RoundTripModel;
  };

detailed case can be found in this pr: Azure/cadl-ranch#587

In this case, TCGC returns UsageFlags for ResultModel is 6(UsageFlags.Input | UsageFlags.Output). But this is a readonly model, which should be output only, and usage should be 4(UsageFlags.Output).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants