code: func expandRefRecursive(ctx *resolveCtx, r *Resolver, v interface{}) (ret interface{}, err error) {
  	if pdebug.Enabled {
  		g := pdebug.Marker("expandRefRecursive")
  		defer g.End()
  	}
  	for {
  		ref, err := findRef(v)
  		if err != nil {
  			if pdebug.Enabled {
  				pdebug.Printf("No refs found. bailing out of loop")
  			}
  			break
  		}
  
  		if pdebug.Enabled {
  			pdebug.Printf("Found ref '%s'", ref)
  		}
  
  		newv, err := expandRef(ctx, r, v, ref)
  		if err != nil {
  			if pdebug.Enabled {
  				pdebug.Printf("Failed to expand ref '%s': %s", ref, err)
  			}
  			return nil, errors.Wrap(err, "failed to expand ref")
  		}
  
  		v = newv
  	}
  
  	return v, nil
  }
docs: // expands $ref with in v, until all $refs are expanded.
  // note: DOES NOT recurse down into structures