fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2109 from hey-api/fix/valibot-iso-date

fix(valibot): use isoDate instead of date for date strings

authored by

Lubos and committed by
GitHub
b754e4ac d0a321b0

+36 -7
+5
.changeset/dry-plums-promise.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix(valibot): use isoDate instead of date for date strings
+4
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators/valibot.gen.ts
··· 46 46 baz: v.optional(v.string()) 47 47 }); 48 48 49 + export const vPatchFooParameterQux = v.pipe(v.string(), v.isoDate()); 50 + 51 + export const vPatchFooParameterQuux = v.pipe(v.string(), v.isoDateTime()); 52 + 49 53 export const vPostFooData = vFoo3;
+4
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators/zod.gen.ts
··· 46 46 baz: z.string().optional() 47 47 }); 48 48 49 + export const zPatchFooParameterQux = z.string().date(); 50 + 51 + export const zPatchFooParameterQuux = z.string().datetime(); 52 + 49 53 export const zPostFooData = zFoo3;
+1 -6
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 44 44 // openapi: '3.1.0', 45 45 // paths: {}, 46 46 // }, 47 - path: path.resolve( 48 - __dirname, 49 - 'spec', 50 - '3.1.x', 51 - 'array-nested-one-of.yaml', 52 - ), 47 + path: path.resolve(__dirname, 'spec', '3.1.x', 'validators.yaml'), 53 48 // path: 'http://localhost:4000/', 54 49 // path: 'https://get.heyapi.dev/', 55 50 // path: 'https://get.heyapi.dev/hey-api/backend?branch=main&version=1.0.0',
+12
packages/openapi-ts-tests/test/spec/3.1.x/validators.yaml
··· 20 20 baz: 21 21 type: string 22 22 type: object 23 + - in: query 24 + name: qux 25 + required: false 26 + schema: 27 + format: date 28 + type: string 29 + - in: query 30 + name: quux 31 + required: false 32 + schema: 33 + format: date-time 34 + type: string 23 35 requestBody: 24 36 content: 25 37 'application/json':
+10 -1
packages/openapi-ts/src/plugins/valibot/plugin.ts
··· 521 521 522 522 if (schema.format) { 523 523 switch (schema.format) { 524 + case 'date': 525 + pipes.push( 526 + compiler.callExpression({ 527 + functionName: compiler.propertyAccessExpression({ 528 + expression: identifiers.v, 529 + name: identifiers.actions.isoDate, 530 + }), 531 + }), 532 + ); 533 + break; 524 534 case 'date-time': 525 535 pipes.push( 526 536 compiler.callExpression({ ··· 552 562 }), 553 563 ); 554 564 break; 555 - case 'date': 556 565 case 'email': 557 566 case 'time': 558 567 case 'uuid':