Skip to content

Commit d84c7db

Browse files
authored
Merge branch 'main' into fix/plugin-transform
2 parents a889c3c + fcb77c9 commit d84c7db

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

.changeset/odd-yaks-love.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+
fix(valibot): use `isoTimestamp` instead of `isoDateTime` for date-time format

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/valibot/default/valibot.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export const vModelWithPattern = v.object({
365365
key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)),
366366
name: v.pipe(v.string(), v.maxLength(255)),
367367
enabled: v.optional(v.pipe(v.boolean(), v.readonly())),
368-
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
368+
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
369369
id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))),
370370
text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))),
371371
patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))),

packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/valibot/default/valibot.gen.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ export const vModelWithPattern = v.object({
691691
key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)),
692692
name: v.pipe(v.string(), v.maxLength(255)),
693693
enabled: v.optional(v.pipe(v.boolean(), v.readonly())),
694-
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
694+
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
695695
id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))),
696696
text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))),
697697
patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))),
@@ -701,8 +701,8 @@ export const vModelWithPattern = v.object({
701701

702702
export const vFile = v.object({
703703
id: v.optional(v.pipe(v.pipe(v.string(), v.minLength(1)), v.readonly())),
704-
updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
705-
created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
704+
updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
705+
created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
706706
mime: v.pipe(v.string(), v.minLength(1), v.maxLength(24)),
707707
file: v.optional(v.pipe(v.pipe(v.string(), v.url()), v.readonly()))
708708
});
@@ -816,15 +816,15 @@ export const vModelWithOneOfEnum = v.union([
816816
])
817817
}),
818818
v.object({
819-
content: v.pipe(v.string(), v.isoDateTime()),
819+
content: v.pipe(v.string(), v.isoTimestamp()),
820820
foo: v.picklist([
821821
'Quux'
822822
])
823823
}),
824824
v.object({
825825
content: v.tuple([
826-
v.pipe(v.string(), v.isoDateTime()),
827-
v.pipe(v.string(), v.isoDateTime())
826+
v.pipe(v.string(), v.isoTimestamp()),
827+
v.pipe(v.string(), v.isoTimestamp())
828828
]),
829829
foo: v.picklist([
830830
'Corge'

packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/valibot/default/valibot.gen.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ export const vModelWithPattern = v.object({
686686
key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)),
687687
name: v.pipe(v.string(), v.maxLength(255)),
688688
enabled: v.optional(v.pipe(v.boolean(), v.readonly())),
689-
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
689+
modified: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
690690
id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))),
691691
text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))),
692692
patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))),
@@ -696,8 +696,8 @@ export const vModelWithPattern = v.object({
696696

697697
export const vFile = v.object({
698698
id: v.optional(v.pipe(v.pipe(v.string(), v.minLength(1)), v.readonly())),
699-
updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
700-
created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())),
699+
updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
700+
created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoTimestamp()), v.readonly())),
701701
mime: v.pipe(v.string(), v.minLength(1), v.maxLength(24)),
702702
file: v.optional(v.pipe(v.pipe(v.string(), v.url()), v.readonly()))
703703
});
@@ -807,14 +807,14 @@ export const vModelWithOneOfEnum = v.union([
807807
])
808808
}),
809809
v.object({
810-
content: v.pipe(v.string(), v.isoDateTime()),
810+
content: v.pipe(v.string(), v.isoTimestamp()),
811811
foo: v.picklist([
812812
'Quux'
813813
])
814814
}),
815815
v.object({
816816
content: v.tuple([
817-
v.pipe(v.string(), v.isoDateTime()),
817+
v.pipe(v.string(), v.isoTimestamp()),
818818
v.string()
819819
]),
820820
foo: v.picklist([

packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-metadata/valibot.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ export const vPatchFooParameterBaz = v.object({
5454

5555
export const vPatchFooParameterQux = v.pipe(v.string(), v.isoDate());
5656

57-
export const vPatchFooParameterQuux = v.pipe(v.string(), v.isoDateTime());
57+
export const vPatchFooParameterQuux = v.pipe(v.string(), v.isoTimestamp());
5858

5959
export const vPostFooData = vFoo3;

packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators/valibot.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ export const vPatchFooParameterBaz = v.object({
5454

5555
export const vPatchFooParameterQux = v.pipe(v.string(), v.isoDate());
5656

57-
export const vPatchFooParameterQuux = v.pipe(v.string(), v.isoDateTime());
57+
export const vPatchFooParameterQuux = v.pipe(v.string(), v.isoTimestamp());
5858

5959
export const vPostFooData = vFoo3;

packages/openapi-ts/src/plugins/valibot/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ const stringTypeToValibotSchema = ({
542542
compiler.callExpression({
543543
functionName: compiler.propertyAccessExpression({
544544
expression: identifiers.v,
545-
name: identifiers.actions.isoDateTime,
545+
name: identifiers.actions.isoTimestamp,
546546
}),
547547
}),
548548
);

0 commit comments

Comments
 (0)