Skip to content

Conversation

@Totorro35
Copy link
Contributor

  • Fix string escape in Zod
  • Inject default enum in place to avoid error

Duplication of #2594

Copilot AI review requested due to automatic review settings December 1, 2025 09:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes two issues in the Zod package: string escaping to handle single quotes correctly, and preventing errors when using enum arrays as default values by inlining them instead of creating separate constants.

  • Fixed string escape logic to properly handle single quotes in string values
  • Changed enum array defaults to be inlined rather than extracted as separate constants
  • Updated tests to reflect the new inline enum array default behavior

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/utils/string.ts Added string escaping for single quotes using replaceAll
packages/zod/src/index.ts Modified enum array default handling to inline values instead of creating constants
packages/zod/src/zod.test.ts Updated test expectations to match new inline enum array default behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Totorro35 Totorro35 closed this Dec 1, 2025
@Totorro35 Totorro35 deleted the zod/string-escape-and-enum branch December 1, 2025 09:52
@Totorro35 Totorro35 restored the zod/string-escape-and-enum branch December 1, 2025 13:28
@Totorro35 Totorro35 reopened this Dec 1, 2025
@melloware melloware added the zod Zod related issue label Dec 1, 2025
@melloware melloware added this to the 8.0.0 milestone Dec 1, 2025
@melloware melloware merged commit 1da5cde into orval-labs:master Dec 1, 2025
2 checks passed
@Totorro35 Totorro35 deleted the zod/string-escape-and-enum branch December 2, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zod Zod related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants