Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
177 stars 73 forks source link

[Bug] API Version Not Respected in `createClient` #2490

Closed joheredi closed 1 week ago

joheredi commented 2 months ago

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:

Suspected Culprit:

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:

dgetu commented 2 months ago

This was fixed in TCGC in #801

dgetu commented 1 week ago

Confirmed fixed by taking a dependency on >=0.42.1