Skip to content
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

change compared api versions when generated addedOn #2580

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading