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

System.ClientModel-based clients: set message.BufferResponse via RequestOptions from convenience methods #4693

Open
annelo-msft opened this issue May 10, 2024 · 0 comments
Labels
v3 Version 3 of AutoRest C# generator.

Comments

@annelo-msft
Copy link
Member

annelo-msft commented May 10, 2024

Once we close Azure/azure-sdk-for-net#43932 (which we plan to ship in System.ClientModel 1.1.0-beta.4), we will need to make sure that generated SCM-based clients don't set message.BufferResponse in request creation helper methods (like we do in DPG clients as shown here). This is because the call to message.Apply(options) will override any value previously set on the message. Instead, protocol methods will always buffer responses based on the value of RequestOptions.BufferResponse, and any convenience method that needs to turn off response buffering should create an instance of RequestOptions, set options.BufferResponse = false, and pass options to the protocol method when it is called.

Feel free to reach out to me if a code sample for this is needed, and please include me as a reviewer of the PR that implements this feature prior to merging. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

No branches or pull requests

1 participant