[release/9.0] [OpenAPI] Use invariant culture for TextWriter #62239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[OpenAPI] Use invariant culture for TextWriter
Use culture-invariant TextWriter implementation for OpenAPI.
Port of #62193 for .NET 9.
Description
Ensure OpenAPI documents are written to a culture-invariant
TextWriter
implementation.To avoid any accidental changes to SignalR's use of
Utf8BufferTextWriter
I've removed the use of the writer pooling for OpenAPI and instead a new instance is created every time.Fixes #60628
@captainsafia If you think this change is worth taking forward for approval I can make any relevant changes you need for that first. I think I've worked out why I couldn't repro the issue in #62193, so I'll make some changes there to check that locally and then push it up to the PR targeting main.