[typespec-ts] Fix sample generation for data-plane services (contentType and bytes)
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 90
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 156
Description
## Overview
Umbrella tracking issue for fixing **sample generation** bugs in the TypeScript emitter (`@azure-tools/typespec-ts`) when emitting samples for data-plane services (`is-modular-library: true`). Migrated from [Azure/autorest.typescript](https://github.com/Azure/autorest.typescript), which is being retired in favor of this repo.
## Work items
- [ ] **`contentType` parameter missing in generated sample client method** — for operations with a `@header("Content-Type")` parameter (e.g. App Configuration `putKeyValue`), the generated sample omits the `contentType` argument.
- Migrated from Azure/autorest.typescript#3595
- [ ] **`bytes` is an unsupported encode in sample gen** — generated samples emit invalid `Buffer.from(..., "bytes")` for `bytes`-typed parameters (e.g. Load Testing `uploadTestFile`); a valid encoding should be used.
- Migrated from Azure/autorest.typescript#3609
## Context
These surfaced while enabling `is-modular-library: true` for data-plane services. Original tracking epic: Azure/autorest.typescript#3615.
## Notes
- Test coverage is tracked as part of each fix above, not as standalone issues.
Contributor guide
Assessment
This issue has not been assessed yet.