Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy committed Sep 24, 2024
1 parent cb3cf47 commit a328c30
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/create/schema/single.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ describe('createSchema', () => {
});
});

it('should create a registered schema', () => {
const schema = createSchema(
z.string().openapi({ description: 'foo', ref: 'String' }),
);

expect(schema).toEqual<SchemaResult>({
schema: {
$ref: '#/components/schemas/String',
},
components: {
String: {
type: 'string',
description: 'foo',
},
},
});
});

it('should create components', () => {
const schema = createSchema(
z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/create/schema/single.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ZodType } from 'zod';

import type { oas30, oas31 } from '../../../dist';
import type { OpenApiVersion } from '../../openapi';
import type { oas30, oas31 } from '../../openapi3-ts/dist';
import {
type CreationType,
createSchemaComponents,
Expand Down

0 comments on commit a328c30

Please sign in to comment.