Skip to content

Commit 7ef9332

Browse files
authored
Merge pull request #3468 from hey-api/copilot/fix-zod-plugin-regex-unicode
Fix Zod and Valibot plugins missing `u` flag on regex patterns with unicode property escapes
2 parents 4474195 + 02d0ed9 commit 7ef9332

174 files changed

Lines changed: 417 additions & 46 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/many-shoes-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
**plugin(zod)**: add `u` flag on regex patterns with unicode property escapes

.changeset/many-shoes-beams.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
**plugin(valibot)**: add `u` flag on regex patterns with unicode property escapes

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,10 @@ export const ModelWithPatternSchema = {
687687
patternWithBacktick: {
688688
type: 'string',
689689
pattern: 'aaa`bbb'
690+
},
691+
patternWithUnicode: {
692+
type: 'string',
693+
pattern: '^\\p{L}+$'
690694
}
691695
}
692696
} as const;
@@ -843,6 +847,10 @@ export const ModelWithPatternWritableSchema = {
843847
patternWithBacktick: {
844848
type: 'string',
845849
pattern: 'aaa`bbb'
850+
},
851+
patternWithUnicode: {
852+
type: 'string',
853+
pattern: '^\\p{L}+$'
846854
}
847855
}
848856
} as const;

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ export type ModelWithPattern = {
390390
patternWithSingleQuotes?: string;
391391
patternWithNewline?: string;
392392
patternWithBacktick?: string;
393+
patternWithUnicode?: string;
393394
};
394395

395396
export type ParameterActivityParams = {
@@ -451,6 +452,7 @@ export type ModelWithPatternWritable = {
451452
patternWithSingleQuotes?: string;
452453
patternWithNewline?: string;
453454
patternWithBacktick?: string;
455+
patternWithUnicode?: string;
454456
};
455457

456458
export type ServiceWithEmptyTagData = {

0 commit comments

Comments
 (0)