code: function convertRef (data) {
    let loc = data['$ref']
    let split = loc.split('#')
    delete data['$ref']
  
    if (loc[0] === '#') {
      data['type'] = utils.typeNameFromRef(loc)
      return data
    } else if (loc.slice(0, 4) === 'http') {
      return JSON.parse(request('GET', split[0]).getBody('utf8'))
    } else {
      return JSON.parse(fs.readFileSync(path.join(basePath, split[0])))
    }
  }
docs: Replace $ref in data with defined type name.
  Type presence in 'definitions' is not validated.
  
  @param  {Object} data - Data containing $ref.
  @returns  {Object}