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

[TCGC] Provide SdkApiVersionParameter as part of SdkParameter #948

Closed
4 tasks done
Tracked by #3994
archerzz opened this issue Jun 4, 2024 · 1 comment
Closed
4 tasks done
Tracked by #3994

[TCGC] Provide SdkApiVersionParameter as part of SdkParameter #948

archerzz opened this issue Jun 4, 2024 · 1 comment
Assignees
Labels
feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@archerzz
Copy link
Member

archerzz commented Jun 4, 2024

Clear and concise description of the problem

api-version is defined as metadata of the whole service, see an example: https://github.com/Azure/azure-rest-api-specs/blob/a5a01e06ffbbc0b0c945cb58fe769d19a4f93af4/specification/devcenter/DevCenter/main.tsp#L34

@doc("DevCenter service")
@versioned(APIVersions)
namespace DevCenterService;
  • It would be better if we could provide SdkApiVersionParameter as part of SdkParameter instead of SdkMethodParameter
  • In csharp (and probably some other languages), api-version is part of client parameters. However, certain service demands that we could provide api-version as method parameter so that users can override it. In that case, if we always provide api-version as method parameter, then we cannot differentiate where we should put api-version in the generated codes.

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@archerzz archerzz added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Jun 4, 2024
@tadelesh tadelesh added the feature New feature or request label Jun 11, 2024
@iscai-msft
Copy link
Contributor

Currently we use .isApiVersion information on parameters for this. This is because api version can be query, path, header etc. So this is by design. If you have an idea, can you go ahead and reopen the issue? I'm closing it because I believe this is by design. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

3 participants