Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[tcgc] add disableUsageAccessPropagationToBase flag and separate exception usage from output usage #1834

Merged
merged 10 commits into from
Nov 13, 2024

Conversation

tadelesh
Copy link
Member

@tadelesh tadelesh commented Nov 11, 2024

resolve: #1827

add disableUsageAccessPropagationToBase flag: this flag aims to support language that does not generate base model, it will skip the base model's propagation but will not skip the property or subtype of the base model.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 11, 2024

All changed packages have been documented.

  • @azure-tools/typespec-client-generator-core
Show changes

@azure-tools/typespec-client-generator-core - feature ✏️

add isPagedResultModel helper function

@azure-tools/typespec-client-generator-core - feature ✏️

add disableUsageAccessPropagationToBase to support language that does not generate base model

@azure-tools/typespec-client-generator-core - fix ✏️

do not add protocol usage for protocol method's response type

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@tadelesh tadelesh changed the title [tcgc] add disableUsageAccessPropagationToBase to support language that does not generate base model [tcgc] add disableUsageAccessPropagationToBase flag and separate exception usage from output usage Nov 13, 2024
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the previous behavior of model only used in @error? Does it has Output?

@tadelesh
Copy link
Member Author

What's the previous behavior of model only used in @error? Does it has Output?

the model with @error or extends from model with @error will have Error usage. and model used in exception response will have usage Output. the problem here is error does not have propagation, and you could not filter out the model only used by that error model.

Copy link
Member

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between Error usage and Exception usage? Why we need them both?

@weidongxu-microsoft
Copy link
Member

What's the previous behavior of model only used in @error? Does it has Output?

the model with @error or extends from model with @error will have Error usage. and model used in exception response will have usage Output. the problem here is error does not have propagation, and you could not filter out the model only used by that error model.

Thanks. Kind of same question as Dapeng's. Not sure if we just have an Error usage which covers all model related to @error model and its reference seems reasonable. Though if we do have some case that we must treat Error and Exception differently, I am fine with that.

@tadelesh tadelesh enabled auto-merge (squash) November 13, 2024 03:32
@tadelesh tadelesh merged commit d16a069 into release/november-2024 Nov 13, 2024
22 checks passed
@tadelesh tadelesh deleted the add_usage_helper branch November 13, 2024 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants