File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ export const createUnknownSchema = <
1010) : oas31 . SchemaObject => {
1111 if ( ! zodSchema . _def . openapi ?. type ) {
1212 const zodType = zodSchema . constructor . name ;
13- const schemaName =
14- zodSchema instanceof ZodEffects
15- ? `${ zodType } - ${ zodSchema . _def . effect . type } `
16- : zodType ;
13+ if ( zodSchema instanceof ZodEffects ) {
14+ const schemaName = `${ zodType } - ${ zodSchema . _def . effect . type } ` ;
15+ throw new Error (
16+ `Unknown schema ${ schemaName } . Please assign it a manual 'type', wrap it in a ZodPipeline or change the 'effectType'.` ,
17+ ) ;
18+ }
1719 throw new Error (
18- `Unknown schema ${ schemaName } . Please assign it a manual type ${
19- zodSchema instanceof ZodEffects ? 'or wrap it in a ZodPipeline' : ''
20- } `,
20+ `Unknown schema ${ zodType } . Please assign it a manual 'type'.` ,
2121 ) ;
2222 }
2323
You can’t perform that action at this time.
0 commit comments