diff --git a/website/src/content/docs/docs/emitters/clients/typespec-go/reference/emitter.md b/website/src/content/docs/docs/emitters/clients/typespec-go/reference/emitter.md index 876afa02fc..05e28ff17c 100644 --- a/website/src/content/docs/docs/emitters/clients/typespec-go/reference/emitter.md +++ b/website/src/content/docs/docs/emitters/clients/typespec-go/reference/emitter.md @@ -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` diff --git a/website/src/content/docs/docs/libraries/typespec-client-generator-core/reference/decorators.md b/website/src/content/docs/docs/libraries/typespec-client-generator-core/reference/decorators.md index ba651aa462..f49371e7f1 100644 --- a/website/src/content/docs/docs/libraries/typespec-client-generator-core/reference/decorators.md +++ b/website/src/content/docs/docs/libraries/typespec-client-generator-core/reference/decorators.md @@ -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 @@ -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.

**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`).

**Valid patterns:**
- Single language: `"python"`
- Multiple languages (comma-separated): `"python, java"`
- 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
reference to a TypeSpec model, in which case the referenced model (including its own decorators,
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.

**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`).

**Valid patterns:**
- Single language: `"python"`
- Multiple languages (comma-separated): `"python, java"`
- Negation to exclude languages: `"!csharp"` or `"!(java, python)"` | #### Examples @@ -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.