File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,24 @@ describe('createSchema', () => {
15
15
} ) ;
16
16
} ) ;
17
17
18
+ it ( 'should create a registered schema' , ( ) => {
19
+ const schema = createSchema (
20
+ z . string ( ) . openapi ( { description : 'foo' , ref : 'String' } ) ,
21
+ ) ;
22
+
23
+ expect ( schema ) . toEqual < SchemaResult > ( {
24
+ schema : {
25
+ $ref : '#/components/schemas/String' ,
26
+ } ,
27
+ components : {
28
+ String : {
29
+ type : 'string' ,
30
+ description : 'foo' ,
31
+ } ,
32
+ } ,
33
+ } ) ;
34
+ } ) ;
35
+
18
36
it ( 'should create components' , ( ) => {
19
37
const schema = createSchema (
20
38
z . object ( {
Original file line number Diff line number Diff line change 1
1
import type { ZodType } from 'zod' ;
2
2
3
- import type { oas30 , oas31 } from '../../../dist' ;
4
3
import type { OpenApiVersion } from '../../openapi' ;
4
+ import type { oas30 , oas31 } from '../../openapi3-ts/dist' ;
5
5
import {
6
6
type CreationType ,
7
7
createSchemaComponents ,
You can’t perform that action at this time.
0 commit comments