code: function lookupType (path, spec, types) {
    const type = (() => {
      const match = R.path(path, spec).match(/^#\/definitions\/(.+)/)
      if (match !== void 0) {
        return match[1]
      } else {
        throw Error(`Reference path does not meet specification: ${path}`)
      }
    })()
  
    if (type in types) {
      return types[type]
    } else {
      throw Error(`Couldn't find definition for ${type}`)
    }
  }
docs: Lookup type
  @rtype (path: [String...], spec: Object, types: Object) => Object
  @param {String[]} path - Path to look up
  @param {Object} spec
  @param {Object} types
  @return {Object} Looked up type definition