_getExternalRefs (schema, fetchUrl, firstIteration = false) {
    if (!firstIteration) this._manageRecursivePointer(schema, fetchUrl)
    const refs = {}
    const mergeRefs = newrefs => Object.keys(newrefs).forEach(i => { refs[i] = true })
    if (schema.$ref && typeof schema.$ref !== 'object' && !(schema.$ref.indexOf('#') === 0 && firstIteration)) {
      let refBase = schema.$ref
      let pointer = ''
      // Strip any JSON pointers found for external refs.
      if (refBase.indexOf('#') > 0) refBase = refBase.substr(0, refBase.indexOf('#'))
      if (refBase !== schema.$ref) pointer = schema.$ref.substr(schema.$ref.indexOf('#'))
      // We use a fragment idenfier to track json pointer in top of our pointer
      const refCounter = this.refs_prefix + this.refs_counter++
      const refPointer = refCounter + pointer
      if (schema.$ref.substr(0, 1) !== '#' && !this.refs[schema.$ref]) {
        refs[refBase] = true
      }
      this.refs_with_info[refCounter] = { fetchUrl, $ref: refBase }
      schema.$ref = refPointer
    }

    Object.values(schema).forEach(value => {
      if (!value || typeof value !== 'object') return
      if (Array.isArray(value)) {
        Object.values(value).forEach(e => {
          if (e && typeof e === 'object') {
            mergeRefs(this._getExternalRefs(e, fetchUrl, firstIteration))
          }
        })
      } else {
        // Merge Ref if it's not a Pointer
        if (!value.$ref || !(typeof value.$ref === 'string' && value.$ref.startsWith('#'))) {
          mergeRefs(this._getExternalRefs(value, fetchUrl, firstIteration))
        }
      }
    })

    if (schema.id && typeof schema.id === 'string' && schema.id.substr(0, 4) === 'urn:') {
      this.refs[schema.id] = schema
    } else if (schema.$id && typeof schema.$id === 'string' && schema.$id.substr(0, 4) === 'urn:') {
      this.refs[schema.$id] = schema
    }
    return refs
  }
Recursively parse a (sub)schema to populate loader reference info.

@param {object} schema - A JSON Schema
@param {string} fetchUrl - Base path from which to store the definitions.
@param {boolean} firstIteration - Is it the first time we load this function? Help making difference between external ref vs internal pointer
@returns {array} Refs in the format of uri => true if external.