From e0d84d942cad0991fe28025a078bafeaf6342463 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Fri, 20 Nov 2020 14:49:21 -0800 Subject: [PATCH] Exclude flattened parameters from method signature (#796) --- src/generators/utils/parameterUtils.ts | 2 +- .../review/web-resource-manager.api.md | 2 +- .../src/webSiteManagementClient.ts | 4 --- .../temp/web-resource-manager.api.json | 30 +++++-------------- .../temp/web-resource-manager.api.md | 2 +- 5 files changed, 10 insertions(+), 30 deletions(-) diff --git a/src/generators/utils/parameterUtils.ts b/src/generators/utils/parameterUtils.ts index 3166b1b4ae..65704cb27d 100644 --- a/src/generators/utils/parameterUtils.ts +++ b/src/generators/utils/parameterUtils.ts @@ -113,7 +113,7 @@ export function getOperationParameterSignatures( ) { const operationParameters = filterOperationParameters(parameters, operation, { includeContentType: true - }); + }).filter(p => !p.isFlattened); const operationRequests = operation.requests; const overloadParameterDeclarations: ParameterWithDescription[][] = []; diff --git a/test/smoke/generated/web-resource-manager/review/web-resource-manager.api.md b/test/smoke/generated/web-resource-manager/review/web-resource-manager.api.md index dc8fd046a5..c1c4e49bb6 100644 --- a/test/smoke/generated/web-resource-manager/review/web-resource-manager.api.md +++ b/test/smoke/generated/web-resource-manager/review/web-resource-manager.api.md @@ -8296,7 +8296,7 @@ export class WebSiteManagementClient extends WebSiteManagementClientContext { // // (undocumented) certificates: Certificates; - checkNameAvailability(request: ResourceNameAvailabilityRequest, name: string, typeParam: CheckNameResourceTypes, options?: WebSiteManagementClientCheckNameAvailabilityOptionalParams): Promise; + checkNameAvailability(name: string, typeParam: CheckNameResourceTypes, options?: WebSiteManagementClientCheckNameAvailabilityOptionalParams): Promise; // Warning: (ae-forgotten-export) The symbol "DeletedWebApps" needs to be exported by the entry point index.d.ts // // (undocumented) diff --git a/test/smoke/generated/web-resource-manager/src/webSiteManagementClient.ts b/test/smoke/generated/web-resource-manager/src/webSiteManagementClient.ts index 5eeab71fa1..c78c63576b 100644 --- a/test/smoke/generated/web-resource-manager/src/webSiteManagementClient.ts +++ b/test/smoke/generated/web-resource-manager/src/webSiteManagementClient.ts @@ -47,7 +47,6 @@ import { WebSiteManagementClientGetSourceControlResponse, WebSiteManagementClientUpdateSourceControlResponse, WebSiteManagementClientListBillingMetersResponse, - ResourceNameAvailabilityRequest, CheckNameResourceTypes, WebSiteManagementClientCheckNameAvailabilityOptionalParams, WebSiteManagementClientCheckNameAvailabilityResponse, @@ -444,19 +443,16 @@ export class WebSiteManagementClient extends WebSiteManagementClientContext { /** * Description for Check if a resource name is available. - * @param request Name availability request. * @param name Resource name to verify. * @param typeParam Resource type used for verification. * @param options The options parameters. */ checkNameAvailability( - request: ResourceNameAvailabilityRequest, name: string, typeParam: CheckNameResourceTypes, options?: WebSiteManagementClientCheckNameAvailabilityOptionalParams ): Promise { const operationArguments: coreHttp.OperationArguments = { - request, name, typeParam, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) diff --git a/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.json b/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.json index ebf9bd91f9..622f5869d6 100644 --- a/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.json +++ b/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.json @@ -63748,20 +63748,11 @@ { "kind": "Method", "canonicalReference": "web-resource-manager!WebSiteManagementClient#checkNameAvailability:member(1)", - "docComment": "/**\n * Description for Check if a resource name is available.\n *\n * @param request - Name availability request.\n *\n * @param name - Resource name to verify.\n *\n * @param typeParam - Resource type used for verification.\n *\n * @param options - The options parameters.\n */\n", + "docComment": "/**\n * Description for Check if a resource name is available.\n *\n * @param name - Resource name to verify.\n *\n * @param typeParam - Resource type used for verification.\n *\n * @param options - The options parameters.\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "checkNameAvailability(request: " - }, - { - "kind": "Reference", - "text": "ResourceNameAvailabilityRequest", - "canonicalReference": "web-resource-manager!ResourceNameAvailabilityRequest:interface" - }, - { - "kind": "Content", - "text": ", name: " + "text": "checkNameAvailability(name: " }, { "kind": "Content", @@ -63814,39 +63805,32 @@ ], "isStatic": false, "returnTypeTokenRange": { - "startIndex": 9, - "endIndex": 13 + "startIndex": 7, + "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { - "parameterName": "request", + "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { - "parameterName": "name", + "parameterName": "typeParam", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { - "parameterName": "typeParam", + "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 } - }, - { - "parameterName": "options", - "parameterTypeTokenRange": { - "startIndex": 7, - "endIndex": 8 - } } ], "name": "checkNameAvailability" diff --git a/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.md b/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.md index dc8fd046a5..c1c4e49bb6 100644 --- a/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.md +++ b/test/smoke/generated/web-resource-manager/temp/web-resource-manager.api.md @@ -8296,7 +8296,7 @@ export class WebSiteManagementClient extends WebSiteManagementClientContext { // // (undocumented) certificates: Certificates; - checkNameAvailability(request: ResourceNameAvailabilityRequest, name: string, typeParam: CheckNameResourceTypes, options?: WebSiteManagementClientCheckNameAvailabilityOptionalParams): Promise; + checkNameAvailability(name: string, typeParam: CheckNameResourceTypes, options?: WebSiteManagementClientCheckNameAvailabilityOptionalParams): Promise; // Warning: (ae-forgotten-export) The symbol "DeletedWebApps" needs to be exported by the entry point index.d.ts // // (undocumented)