File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,17 @@ function getSchema<Schema extends ComponentObject = ComponentObject>(
69
69
} {
70
70
const refInfo = getRefInfo ( schema . $ref , context ) ;
71
71
72
- const { specKey, refPaths } = refInfo ;
72
+ const { specKey, refPaths = [ ] } = refInfo ;
73
73
74
- const schemaByRefPaths : Schema | undefined =
75
- refPaths && get ( context . specs [ specKey || context . specKey ] , refPaths ) ;
74
+ let schemaByRefPaths : Schema | undefined = get (
75
+ context . specs [ context . specKey ] ,
76
+ refPaths ,
77
+ ) ;
78
+ if ( ! schemaByRefPaths ) {
79
+ schemaByRefPaths = context . specs ?. [
80
+ specKey || context . specKey
81
+ ] as unknown as Schema ;
82
+ }
76
83
if ( isReference ( schemaByRefPaths ) ) {
77
84
return getSchema ( schemaByRefPaths , context ) ;
78
85
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { extname } from './path';
9
9
* @param property
10
10
*/
11
11
export const isReference = ( property : any ) : property is ReferenceObject => {
12
- return Boolean ( property . $ref ) ;
12
+ return Boolean ( property ? .$ref ) ;
13
13
} ;
14
14
15
15
export const isDirectory = ( path : string ) => {
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Oct 19, 2023
Successfully deployed to the following URLs:
orval – ./
orval.vercel.app
orval-git-master-anymaniax.vercel.app
www.orval.dev
orval.dev
orval-anymaniax.vercel.app