-
Notifications
You must be signed in to change notification settings - Fork 76
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
Sdk package methods adoption #2943
Conversation
...ics.Management/generated/typespec-ts/sdk/test/arm-test/src/api/dataProductsCatalogs/index.ts
Outdated
Show resolved
Hide resolved
...est/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/models/models.ts
Outdated
Show resolved
Hide resolved
...workAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/restorePollerHelpers.ts
Show resolved
Hide resolved
packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/anonymous/anonymous.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/anonymous/anonymous.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/apiOperations/apiOperations.md
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/apiOperations/apiOperations.md
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/modelsGenerator/modelsGenerator.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/operations/cookieParam/ignoreCookieParam.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/operations/operations.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/operations/operations.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/operations/pathParam/requiredPathWithDefault.md
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/anonymous/anonymous.md
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/operations/cookieParam/ignoreCookieParam.md
Outdated
Show resolved
Hide resolved
…kieParam/ignoreCookieParam.md
packages/typespec-test/test/ai/generated/typespec-ts/review/ai-client.api.md
Show resolved
Hide resolved
packages/typespec-test/test/ai/generated/typespec-ts/src/api/azureAIContext.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/ai/generated/typespec-ts/src/api/connections/index.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/ai/generated/typespec-ts/src/models/models.ts
Show resolved
Hide resolved
packages/typespec-test/test/ai/generated/typespec-ts/src/models/models.ts
Show resolved
Hide resolved
...s/typespec-test/test/anomalyDetector/generated/typespec-ts/src/api/anomalyDetectorContext.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/batch_modular/generated/typespec-ts/review/batch.api.md
Show resolved
Hide resolved
packages/typespec-test/test/batch_modular/generated/typespec-ts/review/batch.api.md
Show resolved
Hide resolved
packages/typespec-test/test/batch_modular/generated/typespec-ts/src/api/batchContext.ts
Show resolved
Hide resolved
packages/typespec-ts/test/modularUnit/scenarios/apiOperations/apiOperations.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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
ModularClientOptions
andModularEmitterOptions
for 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-runtime
for unbranded.Issues found in TCGC
Azure/typespec-azure#1999
Azure/typespec-azure#1994
Azure/typespec-azure#1993
Azure/typespec-azure#1985