code: function (response) {
  
            var i, j, swagger = response.obj;
  
            if(swagger === null || Object.keys(swagger).length === 0) {
              try {
                swagger = JSON.parse(response.data);
              }
              catch (e){
                swagger = {};
              }
            }
  
            processedCalls += 1;
  
            for (i = 0; i < opt.length; i++) {
              var path = opt[i];
              if(path == null) {
                resolvedRefs[name] = {
                  name: name,
                  obj: swagger
                };
              }
              else {
                var location = swagger, parts = path.split('/');
                for (j = 0; j < parts.length; j++) {
                  var segment = parts[j];
                  if(segment.indexOf('~1') !== -1) {
                    segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
                    if(segment.charAt(0) !== '/') {
                      segment = '/' + segment;
                    }
                  }
  
                  if (typeof location === 'undefined') {
                    break;
                  }
  
                  if (segment.length > 0) {
                    location = location[segment];
                  }
                }
                var resolved = host + '#' + path, resolvedName = parts[j-1];
  
                if (typeof location !== 'undefined') {
                  resolvedRefs[resolved] = {
                    name: resolvedName,
                    obj: location
                  };
                } else {
                  unresolvedRefs[resolved] = null;
                }
              }
            }
            if (processedCalls === expectedCalls) {
              self.finish(spec, resolutionTable, resolvedRefs, unresolvedRefs, callback);
            }
          }
docs: jshint ignore:line