Sdk package methods adoption#2943
Merged
qiaozha merged 76 commits intoAzure:mainfrom Dec 26, 2024
Merged
Conversation
qiaozha
commented
Dec 10, 2024
qiaozha
commented
Dec 11, 2024
This was referenced Dec 11, 2024
Closed
qiaozha
commented
Dec 12, 2024
…kieParam/ignoreCookieParam.md
qiaozha
commented
Dec 19, 2024
joheredi
approved these changes
Dec 24, 2024
Member
joheredi
left a comment
There was a problem hiding this comment.
There is nothing that concerns me looking at the api surface changes. The only thing I would like you to get closure on before merging is the addition of accept as a parameter.
MaryGao
reviewed
Dec 25, 2024
Member
MaryGao
left a comment
There was a problem hiding this comment.
Quickly go through most codesnipet but I didn't realize the changes you mention for bytes part. I may take a review again for rest part but I expect no big comments.
MaryGao
approved these changes
Dec 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goals:
Sdk Package method adoptions:
fixes Adopt the getAllOperations in TCGC for modular #2322
fixes Implement TCGC's SdkPackage types #2406
fixes [Epic][DPG] Adopt to the TCGC code model converter #1893
Handle apiVersion at client level.
fixes Should we prompt apiVersion if the service is not versioning controled? #2867
Partially fixes [Codegen/TypeSpec] Handle apiVersion as Path Parameter #2148 in Modular
Support client level path parameter in general.
fixes Support client-level parameter in general for modular #2618
fixes Respect client level parameter in api client factory function #2809
Support generate paging in unbranded as Azure style.
fixes Unbranded CodeGen should generate paging operation with Azure Style #2932
Non Goals:
We should manage the operation reference with binder as what we have done for models, but since this could be done in a separate PR and we are in a tight timeline, prefer to not include it this time.
#2862
Summary of the changes:
1. Adopt to sdkPackage methods
ModularClientOptionsandModularEmitterOptionsfor codegen's own generation options and filepath related logic.2. Support client level path parameter in general.
You will see the path parameter has been lifted to the ClientContext properties, and inside operation send requestion request operation, we will set that value from context.
3. contentType/accept header parameter logic change,
4. apiVersion and its policy related change.
A side note: we can't completely remove the ClientApiVersion policy as in paging nextLink and polling process, we are leveraging glass breaker to help us sending that url, removing the policy in global would cause problems for them.
5. Parameter order related change.
Previously, when we discuss about spread, we have found that we have no way to figure out the order between a normal parameter and body parameter spreaded parameters, but adopt to tcgc has resolved this problem, See this comment for more details #2943 (comment)
6. Bytes gets generated inconsistent as before.
This is because the logic that tcgc uses to infer whether the bytes should be translated as a binary bytes is inconsistent with what we use before, see Azure/typespec-azure#1999. For now, we just trust the encode tcgc returns to us.
7. replace core related dependencies in static helper.
As todo spec in the smoke test has paging operation, we have to generate paginate helper for it which has some core related dependencies, we have to replace those dependencies into
@typespec/ts-http-runtimefor unbranded.Issues found in TCGC
Azure/typespec-azure#1999
Azure/typespec-azure#1994
Azure/typespec-azure#1993
Azure/typespec-azure#1985