File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,6 @@ const ensureCompliance = ({
211211 ...rest
212212} : JSONSchema . BaseSchema ) : SchemaObject | ReferenceObject => {
213213 if ( $ref ) return { $ref } ;
214- if ( typeof type === "string" ) type = isSupportedType ( type ) ? type : undefined ;
215214 return {
216215 type : Array . isArray ( type )
217216 ? type . filter ( isSupportedType )
@@ -490,14 +489,14 @@ const fixReferences = (
490489 const actualName = entry . $ref . split ( "/" ) . pop ( ) ! ;
491490 const depiction = defs [ actualName ] ;
492491 if ( depiction )
493- entry . $ref = ctx . makeRef ( depiction , depiction as SchemaObject ) . $ref ; // @todo see below
492+ entry . $ref = ctx . makeRef ( depiction , ensureCompliance ( depiction ) ) . $ref ;
494493 continue ;
495494 }
496495 stack . push ( ...R . values ( entry ) ) ;
497496 }
498497 if ( R . is ( Array , entry ) ) stack . push ( ...R . values ( entry ) ) ;
499498 }
500- return subject as SchemaObject ; // @todo ideally, there should be a method to ensure that
499+ return ensureCompliance ( subject ) ;
501500} ;
502501
503502/** @link https://github.com/colinhacks/zod/issues/4275 */
You can’t perform that action at this time.
0 commit comments