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] Add a clientOption(name, value, scope) decorator #2228

Open
4 tasks done
lmazuel opened this issue Feb 18, 2025 · 0 comments
Open
4 tasks done

[TCGC] Add a clientOption(name, value, scope) decorator #2228

lmazuel opened this issue Feb 18, 2025 · 0 comments
Labels
feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@lmazuel
Copy link
Member

lmazuel commented Feb 18, 2025

Clear and concise description of the problem

We want to be able to pass experimental flags fast to emitter, without having to reship TCGC. For instance:

@clientOption("enableFeatureFoo", true, "python")
model MyModel {}

Target can be anything, name is a string, value can be anything (emitter's job to cast), and scope as usual.

We should have a permanent linter rule applied to that decorator, that's it's required to suppress. This is intended for experiment, or quick escape hatch and shouldn't be used outside of that context, or needs to be justified in the suppression.

Options of that decorator are NOT expected to be documented publicly, for the reason given before.

I expect this to be exposed in the TCGC YAML as something like a list:

clientOption:
- enableFeatureFoo: true

And any emitter can check if "clientOption" for something they support is there or not.

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.
@lmazuel lmazuel added feature New feature or request lib:tcgc Issues for @azure-tools/typespec-client-generator-core library labels Feb 18, 2025
@lmazuel lmazuel changed the title [TCGC] Adde a clientOption(name, value, scope) decorator [TCGC] Add a clientOption(name, value, scope) decorator Feb 18, 2025
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

1 participant