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] do not replace operation with @override when listOperationsInOperationGroup #1858

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

tadelesh
Copy link
Member

fix: #1857

@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 13, 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 - breaking ✏️

deprecate Error usage and add Exception usage. �for all models used in exception response, they will no longer have Output usage, but have Exception usage.

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

do not replace operation with @override when listOperationsInOperationGroup

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

add isOverride flag to SdkServiceMethod.

@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

@@ -586,7 +586,7 @@ export function listOperationsInOperationGroup(
for (const op of current.operations.values()) {
// Skip templated operations
if (!isTemplateDeclarationOrInstance(op)) {
operations.push(getOverriddenClientMethod(context, op) ?? op);
operations.push(op);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the decided way to proceed until every language can fully support overrides? I feel it would be better to still return these instead of the original, and we could tell emitter authors that it's overridden, and we can point back to the original operation as well

Copy link
Member Author

Choose a reason for hiding this comment

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

listOperationsInOperationGroup is a decorator helper, which return the raw typespec operation. if you return the override one, then http payload will be changed. it is a bug, not a design change.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh i see, approving

@tadelesh tadelesh requested a review from iscai-msft November 15, 2024 02:22
- "@azure-tools/typespec-client-generator-core"
---

do not replace operation with `@override` when `listOperationsInOperationGroup`
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Nov 15, 2024

Choose a reason for hiding this comment

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

Does it only affect listOperationsInOperationGroup?

Java emitter currently list SdkServiceMethod under client.methods.

From the context, this seems also should not be the @override operation -- SdkServiceMethod should have the signature of the override operation in SdkServiceMethod, while having the signature of the original/overrided operation in SdkServiceOperation

Copy link
Member Author

Choose a reason for hiding this comment

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

it is just a bug for previous @override impl. for SdkServiceMethod it will use the @override operation, for SdkServiceOperation it will use the original operation, these two logic is right for the impl.

@iscai-msft iscai-msft merged commit 5f2f74a into release/november-2024 Nov 18, 2024
22 checks passed
@iscai-msft iscai-msft deleted the fix_override branch November 18, 2024 15:26
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