Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ The module into which the package is being emitted. Mutually exclusive with modu

When true, unmarshalers will return an error when an unknown field is encountered in the payload. The default is false.

### `emit-content-type-header`

**Type:** `boolean`

Includes the Content-Type header in response envelopes for modeled responses. The default is false.

### `file-prefix`

**Type:** `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ See supported client options for each language emitter here https://azure.github
warning if no scope is provided (since options are typically language-specific).

```typespec
@Azure.ClientGenerator.Core.clientOption(name: valueof string, value: valueof unknown, scope?: valueof string)
@Azure.ClientGenerator.Core.clientOption(name: valueof string, value: unknown | valueof unknown, scope?: valueof string)
```

#### Target
Expand All @@ -743,11 +743,11 @@ The type you want to apply the option to.

#### Parameters

| Name | Type | Description |
| ----- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | `valueof string` | The name of the option (e.g., "enableFeatureFoo"). |
| value | `valueof unknown` | The value of the option. Can be any type; emitters will cast as needed. |
| scope | `valueof string` | Specifies the target language emitters that the decorator should apply. If not set, the decorator will be applied to all language emitters by default.<br /><br />**Supported language identifiers:** `csharp`, `python`, `java`, `javascript`, `go`, and other language emitter names (derived from the emitter package name, e.g., `@azure-tools/typespec-csharp` → `csharp`).<br /><br />**Valid patterns:**<br />- Single language: `"python"`<br />- Multiple languages (comma-separated): `"python, java"`<br />- Negation to exclude languages: `"!csharp"` or `"!(java, python)"` |
| Name | Type | Description |
| ----- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | `valueof string` | The name of the option (e.g., "enableFeatureFoo"). |
| value | `unknown` \| `valueof unknown` | The value of the option. Can be a literal value (string, boolean, number, etc.) or a<br />reference to a TypeSpec model, in which case the referenced model (including its own decorators,<br />such as `@alternateType`) is preserved so the scoped emitter can resolve it. Emitters will cast as needed. |
| scope | `valueof string` | Specifies the target language emitters to which the decorator applies. Every use must provide an explicit scope; omitting it produces an additional warning.<br /><br />**Supported language identifiers:** `csharp`, `python`, `java`, `javascript`, `go`, and other language emitter names (derived from the emitter package name, e.g., `@azure-tools/typespec-csharp` → `csharp`).<br /><br />**Valid patterns:**<br />- Single language: `"python"`<br />- Multiple languages (comma-separated): `"python, java"`<br />- Negation to exclude languages: `"!csharp"` or `"!(java, python)"` |

#### Examples

Expand All @@ -761,6 +761,14 @@ model MyModel {
}
```

##### Apply an experimental option that references a model

```typespec
#suppress "@azure-tools/typespec-client-generator-core/client-option" "preview feature for csharp"
@clientOption("composes", OpenAICreateResponseOptions, "csharp")
model FoundryCreateResponseOptions {}
```

### `@convenientAPI` {#@Azure.ClientGenerator.Core.convenientAPI}

Whether you want to generate an operation as a convenient method.
Expand Down