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

[Bug] API Version Not Respected in createClient #2490

Closed
joheredi opened this issue May 2, 2024 · 2 comments
Closed

[Bug] API Version Not Respected in createClient #2490

joheredi opened this issue May 2, 2024 · 2 comments
Assignees
Labels

Comments

@joheredi
Copy link
Member

joheredi commented May 2, 2024

Description:
When generating a client that targets a specific API version, the generated createClient function does not respect the specified api-version flag in tspconfig.yaml. Although models and operations for the specific version are generated correctly, createClient defaults to the latest version instead of the specified one.

Relevant Details:

  • TCGC was updated to support targeting specific API versions through the api-version flag in tspconfig.yaml, as introduced by this change.
  • The TypeScript emitter is already utilizing TCGC with this feature support.
  • The issue is specifically observed in the generated createClient function which continues to use the default (latest) API version.

Suspected Culprit:

  • The issue might be stemming from how the API version is handled or defaulted in the createClient function within the TypeScript Emitter. Specifically, the logic in this line of code might be ignoring the specified API version.

Steps to Reproduce:

  1. Configure tspconfig.yaml with a specific api-version.
  2. Generate a client using the Typescript Emitter.
  3. Observe that the generated client's createClient function defaults to the latest API version instead of using the specified version.

Expected Behavior:
The createClient function should respect the API version specified in tspconfig.yaml and use it instead of defaulting to the latest version.

Actual Behavior:
The createClient function ignores the specified API version and defaults to the latest version.

Screenshots/Logs:
Issue Screenshot

Environment:

  • Typescript Emitter version: 0.28.0
  • Typespec Compiler version: 0.55.0
@dgetu
Copy link
Member

dgetu commented May 9, 2024

This was fixed in TCGC in #801

@lirenhe lirenhe added P1 priority 1 and removed p0 priority 0 labels May 31, 2024
@dgetu
Copy link
Member

dgetu commented Jul 10, 2024

Confirmed fixed by taking a dependency on >=0.42.1

@dgetu dgetu closed this as completed Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants