Skip to content

Commit

Permalink
change compared api versions when generated addedOn
Browse files Browse the repository at this point in the history
  • Loading branch information
tadelesh committed May 8, 2024
1 parent 45337a1 commit 3283333
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/typespec-python/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ export function getAddedOn<TServiceOperation extends SdkServiceOperation>(
context: PythonSdkContext<TServiceOperation>,
type: SdkModelPropertyType | SdkMethod<TServiceOperation>,
): string | undefined {
// We only want added on if it's not the same as the client's added on
if (type.apiVersions[0] === context.experimental_sdkPackage.clients[0].apiVersions[0]) return undefined;
// since we do not support multi-service for now, we can just check the root client's api version
// if type is added in the first version of the client, we do not need to add the versioning info
if (type.apiVersions[0] === context.experimental_sdkPackage.clients.find(c => c.initialization.access === "public")?.apiVersions[0]) return undefined;
return type.apiVersions[0];
}

Expand Down

0 comments on commit 3283333

Please sign in to comment.