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

[Bug]: tcgc, diagnostic, false positive on method with spread #1675

Closed
4 tasks done
weidongxu-microsoft opened this issue Oct 12, 2024 · 2 comments
Closed
4 tasks done
Assignees
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Oct 12, 2024

Describe the bug

The diagnostic is error and cannot be ignored.

TCGC appears to be wrong when the method body parameter got spread (or maybe only when there is 2 spread in body?).

error @azure-tools/typespec-client-generator-core/no-corresponding-method-param: Missing "completeRequest" method parameter in method "complete", when "completeRequest" must be sent to the service. Add a parameter named "completeRequest" to the method.
error @azure-tools/typespec-client-generator-core/no-corresponding-method-param: Missing "embedRequest" method parameter in method "embed", when "embedRequest" must be sent to the service. Add a parameter named "embedRequest" to the method.
error @azure-tools/typespec-client-generator-core/no-corresponding-method-param: Missing "embedRequest1" method parameter in method "embed", when "embedRequest1" must be sent to the service. Add a parameter named "embedRequest1" to the method.

log

full run on existing libs

Reproduction

source is
https://github.com/Azure/azure-rest-api-specs/blob/016b80ae90f5fabc1e572efabd3ecb1030d444c0/specification/ai/ModelClient/routes.tsp#L26
(it is not merged to main branch, PR Azure/azure-rest-api-specs#28438)

SDK at https://github.com/Azure/azure-sdk-for-java/tree/5e07b10d9b04fe8c73a4ee6c78f8aeb9786e0543/sdk/ai/azure-ai-inference

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@tadelesh
Copy link
Member

The root cause is from: microsoft/typespec#4757. Suggestion: refine the spec definition since spread additional properties model in body is meaningless.

@weidongxu-microsoft
Copy link
Member Author

Asking service to update the tsp https://github.com/Azure/azure-rest-api-specs/pull/28438/files#r1802429139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

2 participants