Fix PowerShell script encoding, regex specificity, and version validation#1482
Draft
Copilot wants to merge 2 commits into
Draft
Fix PowerShell script encoding, regex specificity, and version validation#1482Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
- Add UTF-8 encoding to all Set-Content calls to prevent encoding issues - Remove -NoNewline flag to preserve line endings - Make hash regex replacements specific to OpenApiGenerator resources - Add version format validation for multi-digit components Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update OpenAPI Generator to version 7.20.0
Fix PowerShell script encoding, regex specificity, and version validation
Feb 16, 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.
Addresses code review feedback on the OpenAPI Generator update automation script to fix encoding issues, prevent unintended hash replacements, and improve version format validation.
Changes
Encoding fixes: All
Set-Contentcalls now specify-Encoding UTF8and remove-NoNewlineto prevent UTF-16 rewrites on Windows PowerShell 5.1 and preserve trailing newlinesRegex specificity: Hash replacements in
Resource.Designer.csnow use(?s)(OpenApiGenerator_MD5.*?Looks up a localized string similar to )[0-9a-f]{32}(\.)to scope replacements to the correct resource blocks and avoid overwriting SwaggerCodegenCli/LegacyOpenApiGenerator hashesVersion validation: Added format validation (3-part semver), numeric component checks, and warnings for multi-digit minor/patch versions that may break enum naming assumptions
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.