Conversation
Use CultureInfo.InvariantCulture instead of CultureInfo.CurrentCulture in DefaultDeprecationNotice and DefaultSunsetNotice to ensure consistent date formatting across all locales (e.g., 01/01/2026 instead of culture-specific 1/1/2026 or 1-1-2026). Replace StringBuilder.AppendLine() with explicit '\n' line endings in ApiExplorerTransformer to produce consistent Markdown output regardless of the operating system (Environment.NewLine varies between platforms). Update expected test values and Content/v1.json to match the invariant culture date format and consistent line endings. Co-authored-by: sander1095 <7312681+sander1095@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix culture issues in AcceptanceTests
Fix culture-dependent date formatting and cross-platform line endings in OpenAPI document generation
Feb 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix culture-dependent date formatting and cross-platform line endings in OpenAPI document generation
Use
CultureInfo.InvariantCultureand explicit\nline endings so OpenAPI documents are identical regardless of locale or OS.Description
OpenAPI acceptance tests fail on non-
en-USmachines (e.g. Dutch locale) because deprecation/sunset dates are formatted viaCultureInfo.CurrentCulturewith{1:d}, producing locale-specific output (1/1/2026vs1-1-2026). Additionally,StringBuilder.AppendLine()emits\r\non Windows and\non Linux, causing cross-platform mismatches against the expected JSON fixture.OpenApiDocumentDescriptionOptions.cs—CultureInfo.CurrentCulture→CultureInfo.InvariantCultureinDefaultDeprecationNoticeandDefaultSunsetNoticeApiExplorerTransformer.cs— ReplaceAppendLine()with explicitAppend('\n')in Markdown generation for deterministic outputOpenApiDocumentDescriptionOptionsTest.cs— Update expected dates to invariant format (02/08/2026)Content/v1.json— Update dates and\r\n→\nto match corrected output💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.