@@ -37,7 +37,7 @@ export class SchemaTree extends Tree {
3737 populateTree ( this . schema , this . root , 0 , [ ] , {
3838 mergeAllOf : this . mergeAllOf ,
3939 onNode : ( node , parentTreeNode , level ) : boolean => {
40- if ( isRefNode ( node ) && isLocalRef ( node . $ref ) ) {
40+ if ( isRefNode ( node ) && node . $ref !== null && isLocalRef ( node . $ref ) ) {
4141 expanded [ node . id ] = false ;
4242 }
4343
@@ -81,7 +81,9 @@ export class SchemaTree extends Tree {
8181
8282 const metadata = getNodeMetadata ( node ) ;
8383 const { path, schemaNode, schema } = metadata ;
84- if ( isRefNode ( schemaNode ) ) {
84+ if ( ! isRefNode ( schemaNode ) ) {
85+ this . populateTreeFragment ( node , schema , path ) ;
86+ } else if ( schemaNode . $ref !== null ) {
8587 const refPath = pointerToPath ( schemaNode . $ref ) ;
8688 const schemaFragment = this . resolveRef ? this . resolveRef ( refPath , this . schema ) : _get ( this . schema , refPath ) ;
8789 if ( ! _isObject ( schemaFragment ) ) {
@@ -91,7 +93,7 @@ export class SchemaTree extends Tree {
9193 this . populateTreeFragment ( node , schemaFragment , path ) ;
9294 metadata . schema = schemaFragment ;
9395 } else {
94- this . populateTreeFragment ( node , schema , path ) ;
96+ throw new Error ( `I do know not how not expand node ${ path . join ( '.' ) } ` ) ;
9597 }
9698
9799 this . visited . add ( node ) ;
0 commit comments