Conversation
… wrap-non-model-return enabled Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/f170ca53-8db2-4eaf-b1a0-06ef4ce0bb46 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
… duplication Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/f170ca53-8db2-4eaf-b1a0-06ef4ce0bb46 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
{ body: boolean } in Modular SDK with wrap-non-model-return
|
@copilot Following HLC’s implementation logic https://github.com/Azure/autorest.typescript/blob/main/packages/autorest.typescript/src/generators/modelsGenerator.ts#L224, validate the current fix and resolve the CI failures. |
…rations Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/8123dd9c-ecc7-4343-a3da-98c93d93c445 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/8123dd9c-ecc7-4343-a3da-98c93d93c445 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Following the HLC logic which requires
Key changes in
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
{ body: boolean } in Modular SDK with wrap-non-model-return{ body: boolean } in Modular SDK with wrap-non-model-return and head-as-boolean
|
@copilot According to typespec operation checkExistenceAtManagementGroupScope to add UT https://github.com/Azure/azure-rest-api-specs/blob/99cfa558b8ed9c11464a426f401406531c26d6ce/specification/resources/resource-manager/Microsoft.Resources/deployments/DeploymentExtended.tsp#L447 expected response code is |
…on unit test Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/f9190dbe-590c-4b7f-9cde-0a91dd412baa Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Added in @route("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@head
op checkExistenceAtManagementGroupScope(
@path groupId: string,
@path deploymentName: string,
): { @statusCode _: 204; } | { @statusCode _: 404; };With
|
|
@copilot revert commit |
… unit test Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/0efd0cf1-d41d-488e-bb0b-4d5804176b5d Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Reverted in |
|
@qiaozha, could you help to review this PR? thanks |
|
@copilot please resolve comment #3887 (comment) and #3887 (comment) |
…odel-return is false Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/4c293779-5e0d-4d27-a332-82eec0ff0ad4 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Resolved in
Changes: |
{ body: boolean } in Modular SDK with wrap-non-model-return and head-as-booleanboolean or { body: boolean } in Modular SDK with head-as-boolean and wrap-non-model-return
|
@copilot Run |
Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/6e0b603f-c6b9-48e7-bbf6-3586839962e1 Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Done in |
A new
head-as-booleanoption (mirroring HLC's--head-as-boolean) enables boolean return types for HEAD operations with no response body in the Modular SDK. The behavior depends on the combination ofhead-as-booleanandwrap-non-model-return:wrap-non-model-returnhead-as-booleantruetruePromise<{ body: boolean }>falsetruePromise<boolean>truefalsePromise<void>falsefalsePromise<void>The dedicated
head-as-booleanopt-in prevents unintended changes to HEAD operations likeheadIfModifiedSince(conditional request headers) which must continue to returnvoid.Changes
rlc-common/src/interfaces.tsheadAsBoolean?: booleanto theRLCOptionsinterfacetypespec-ts/src/lib.ts"head-as-boolean"emitter option with JSON schema descriptiontypespec-ts/src/transform/transfromRLCOptions.tshead-as-booleanemitter option through toheadAsBooleaninRLCOptionstypespec-ts/test/util/emitUtil.tshead-as-booleanoption in the test utility so scenario YAML configs can set itoperationHelpers.tsisHeadOperation()— new helper to centralize the HTTP verb checkcheckWrapNonModelReturn()— HEAD + void response returns{ shouldWrap: true }only when bothwrapNonModelReturnandheadAsBooleanare enabledbuildNonModelResponseTypeDeclaration()— emits{ body: boolean }type body for HEAD void operations when bothhead-as-booleanandwrap-non-model-returnare setgetDeserializePrivateFunction()— two cases:wrap-non-model-return: true: generatesreturn { body: result.status.startsWith("2") }wrap-non-model-return: false: generatesreturn result.status.startsWith("2")(plain boolean)getOperationFunction()— returnsPromise<boolean>whenhead-as-boolean: trueandwrap-non-model-return: falseExamples
With
wrap-non-model-return: trueandhead-as-boolean: true:With
wrap-non-model-return: falseandhead-as-boolean: true:HEAD operations without
head-as-boolean: truecontinue to returnPromise<void>unchanged.Tests
Unit test scenarios in
wrapNonModelReturn.mdcover all four combinations ofwrap-non-model-returnandhead-as-booleanfor HEAD operations.