From 4a4c377002f603a59d7604fe3b5d2a584764ab77 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:43:37 -0400 Subject: [PATCH] [tcgc] remove unused overloads and overloading from method (#511) --- .../remove_overloads_overloading-2024-2-25-13-55-57.md | 7 +++++++ packages/typespec-client-generator-core/doc/types.tsp | 4 ---- .../typespec-client-generator-core/src/interfaces.ts | 9 +++------ packages/typespec-client-generator-core/src/package.ts | 1 - 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 .chronus/changes/remove_overloads_overloading-2024-2-25-13-55-57.md diff --git a/.chronus/changes/remove_overloads_overloading-2024-2-25-13-55-57.md b/.chronus/changes/remove_overloads_overloading-2024-2-25-13-55-57.md new file mode 100644 index 0000000000..7d184f34b4 --- /dev/null +++ b/.chronus/changes/remove_overloads_overloading-2024-2-25-13-55-57.md @@ -0,0 +1,7 @@ +--- +changeKind: deprecation +packages: + - "@azure-tools/typespec-client-generator-core" +--- + +Remove support for unused `.overloads` and `.overloading` on `SdkMethod` \ No newline at end of file diff --git a/packages/typespec-client-generator-core/doc/types.tsp b/packages/typespec-client-generator-core/doc/types.tsp index 4230d661e6..ea230262b1 100644 --- a/packages/typespec-client-generator-core/doc/types.tsp +++ b/packages/typespec-client-generator-core/doc/types.tsp @@ -531,8 +531,6 @@ alias SdkServiceParameter = SdkQueryServiceParameter | SdkHeaderServiceParameter * @property parameters: Parameters object for the method * @property description: Description of the operation * @property details: Optional details of the operation - * @property overloads: Any overloads of this method - * @property overloading: The method that this method overloads */ @discriminator("kind") model SdkMethod { @@ -541,8 +539,6 @@ model SdkMethod { parameters: SdkMethodParameter[]; description?: string; details?: string; - overloads?: SdkMethod[]; - overloading?: SdkMethod; } /** diff --git a/packages/typespec-client-generator-core/src/interfaces.ts b/packages/typespec-client-generator-core/src/interfaces.ts index 8bdb045e4f..e81c9c1606 100644 --- a/packages/typespec-client-generator-core/src/interfaces.ts +++ b/packages/typespec-client-generator-core/src/interfaces.ts @@ -451,7 +451,7 @@ export interface SdkHttpOperation extends SdkServiceOperationBase { export type SdkServiceOperation = SdkHttpOperation; export type SdkServiceParameter = SdkHttpParameter; -interface SdkMethodBase { +interface SdkMethodBase { __raw?: Operation; name: string; access: AccessFlags | undefined; @@ -459,12 +459,10 @@ interface SdkMethodBase { apiVersions: string[]; description?: string; details?: string; - overloads?: SdkMethod[]; - overloading?: SdkMethod; } interface SdkServiceMethodBase - extends SdkMethodBase { + extends SdkMethodBase { getParameterMapping(serviceParam: SdkServiceParameter): SdkModelPropertyType[]; operation: TServiceOperation; parameters: SdkMethodParameter[]; @@ -515,8 +513,7 @@ export type SdkServiceMethod = | SdkLroPagingServiceMethod | SdkLroPagingServiceMethod; -interface SdkClientAccessor - extends SdkMethodBase { +interface SdkClientAccessor extends SdkMethodBase { kind: "clientaccessor"; response: SdkClientType; } diff --git a/packages/typespec-client-generator-core/src/package.ts b/packages/typespec-client-generator-core/src/package.ts index d129ab4219..1997b2afd1 100644 --- a/packages/typespec-client-generator-core/src/package.ts +++ b/packages/typespec-client-generator-core/src/package.ts @@ -564,7 +564,6 @@ function getSdkBasicServiceMethod< parameters: methodParameters.filter((x) => !x.isApiVersionParam), description: getDocHelper(context, operation).description, details: getDocHelper(context, operation).details, - overloads: [], operation: serviceOperation, response, apiVersions: getAvailableApiVersions(context, operation),