aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

[OpenAPI] Use invariant culture for TextWriter

Open martincostello opened this issue 6 months ago • 9 comments

Use invariant culture for TextWriter

Use culture-invariant TextWriter implementation for OpenAPI.

Description

  • Ensure OpenAPI documents are written to a culture-invariant TextWriter implementation.
  • Add/update unit/integration tests to ensure the invariant culture is used to generate the OpenAPI document regardless of the current culture.
  • Add support for emitting exclusiveMinimum/exclusiveMaximum instead of minimum/maximum where relevant based on the values of RangeAttribute properties.

~~I couldn't replicate this issue in .NET 10, I'm guessing Microsoft.OpenApi has had some internal refactoring that means that it's no longer using an overload on TextWriter that was hitting this (unless I messed up my test to repro it somehow).~~

  • Contributes to #60628.
  • Contributes to #61965.

martincostello avatar May 31 '25 14:05 martincostello