Skip to content

Thread ModelReaderWriterOptions through generated clients#11390

Draft
JonathanCrd wants to merge 2 commits into
microsoft:mainfrom
JonathanCrd:jonathancrd/implement-codegen-spec
Draft

Thread ModelReaderWriterOptions through generated clients#11390
JonathanCrd wants to merge 2 commits into
microsoft:mainfrom
JonathanCrd:jonathancrd/implement-codegen-spec

Conversation

@JonathanCrd

@JonathanCrd JonathanCrd commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • cache one wire-format ModelReaderWriterOptions on each generated client
  • reuse the static wire options when no client options are configured
  • thread the cached options through request serialization, response deserialization, subclients, paging, multipart content, and nested model writes
  • add generator coverage and regenerate Sample/Spector baselines

Dependency

Draft pending the corresponding System.ClientModel APIs in Azure/azure-sdk-for-net#59083, including ClientPipelineOptions.ModelReaderWriterOptions, proxy resolution, and ModelReaderWriterOptions(string format, ModelReaderWriterOptions options).

The C# generated-project test jobs will continue to fail while CI restores the published System.ClientModel 1.14.0 package, which does not contain those APIs. The generator behavior was validated against a local package built from the proxy-rw branch.

Validation

  • full Microsoft.TypeSpec.Generator.ClientModel.Tests suite before regeneration
  • local System.ClientModel package integration for generated Sample code
  • pnpm format
  • npm run cop
  • regenerated all Sample and Spector projects

Cache wire-format ModelReaderWriterOptions on generated clients and use them across request serialization, response deserialization, subclients, paging, and multipart content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d567d847-242a-47b9-af86-5e3eb1dd7031
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jul 24, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@11390

commit: e301160

@github-actions

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

Regenerate Sample and Spector outputs for threaded ModelReaderWriterOptions and mark derived ToBinaryContent helpers as new only when they hide a generated base helper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d567d847-242a-47b9-af86-5e3eb1dd7031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant