docs: function getRefSchema (refVal, refType, parent, options, state) {
    const loader = getLoader(refType, options)
    if (refType && loader) {
      let newVal
      let oldBasePath
      let loaderValue
      let filePath
      let fullRefFilePath
  
      if (refType === 'file') {
        filePath = utils.getRefFilePath(refVal)
        fullRefFilePath = utils.isAbsolute(filePath) ? filePath : path.resolve(state.cwd, filePath)
  
        if (cache[fullRefFilePath]) {
          loaderValue = cache[fullRefFilePath]
        }
      }
  
      if (!loaderValue) {
        loaderValue = loader(refVal, options)
        if (loaderValue) {
          // adjust base folder if needed so that we can handle paths in nested folders
          if (refType === 'file') {
            let dirname = path.dirname(filePath)
            if (dirname === '.') {
              dirname = ''
            }
  
            if (dirname) {
              oldBasePath = state.cwd
              const newBasePath = path.resolve(state.cwd, dirname)
              options.baseFolder = state.cwd = newBasePath
            }
          }
  
          loaderValue = derefSchema(loaderValue, options, state)
  
          // reset
          if (oldBasePath) {
            options.baseFolder = state.cwd = oldBasePath
          }
        }
      }
  
      if (loaderValue) {
        if (refType === 'file' && fullRefFilePath && !cache[fullRefFilePath]) {
          cache[fullRefFilePath] = loaderValue
        }
  
        if (refVal.indexOf('#') >= 0) {
          const refPaths = refVal.split('#')
          const refPath = refPaths[1]
          const refNewVal = utils.getRefPathValue(loaderValue, refPath)
          if (refNewVal) {
            newVal = refNewVal
          }
        } else {
          newVal = loaderValue
        }
      }
  
      return newVal
    } else if (refType === 'local') {
      return utils.getRefPathValue(parent, refVal)
    }
  }