这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/openapi-ts-tests/main/test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import path from 'node:path';

import { sync } from 'cross-spawn';
import { describe, expect, it } from 'vitest';
import { beforeAll,describe, expect, it } from 'vitest';

import { getSpecsPath } from '../../utils';

const specs = getSpecsPath();

describe('bin', () => {
beforeAll(() => {});

it('openapi-ts works', () => {
const result = sync('openapi-ts', [
'--input',
Expand All @@ -17,7 +19,8 @@ describe('bin', () => {
'--dry-run',
'true',
]);

expect(result.error).toBeFalsy();
expect(result.status).toBe(0);
});
}, 60000);
});
1 change: 1 addition & 0 deletions packages/openapi-ts/src/plugins/valibot/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { defaultConfig, defineConfig } from './config';
export type { ValibotPlugin } from './types';
export * as v1 from './v1';
3 changes: 3 additions & 0 deletions packages/openapi-ts/src/plugins/valibot/v1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './constants';
export * from './plugin';
export * as toAst from './toAst';
11 changes: 10 additions & 1 deletion packages/openapi-ts/src/plugins/valibot/v1/toAst/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ export const stringToAst = ({
}),
);
break;
case 'time':
pipes.push(
tsc.callExpression({
functionName: tsc.propertyAccessExpression({
expression: v.placeholder,
name: identifiers.actions.isoTime, // ✅ FIXED HERE
}),
}),
);
break;
case 'ipv4':
case 'ipv6':
pipes.push(
Expand All @@ -83,7 +93,6 @@ export const stringToAst = ({
);
break;
case 'email':
case 'time':
case 'uuid':
pipes.push(
tsc.callExpression({
Expand Down
Loading