usebruno/bruno · error · BrunoError

Import collection failed: ${err.message}

Error message

Import collection failed: ${err.message}

What it means

Thrown by convertOpenapiToBruno when the @usebruno/converters openApiToBruno() function throws. Generic prefix wraps the original converter error which is also console.error-ed.

Source

Thrown at packages/bruno-app/src/utils/importers/openapi-collection.js:9

import { BrunoError } from 'utils/common/error';
import { openApiToBruno } from '@usebruno/converters';

export const convertOpenapiToBruno = (data, options = {}) => {
  try {
    return openApiToBruno(data, options);
  } catch (err) {
    console.error('Error converting OpenAPI to Bruno:', err);
    throw new BrunoError('Import collection failed: ' + err.message);
  }
};

export const isOpenApiSpec = (data) => {
  if (!data || typeof data !== 'object') {
    return false;
  }

  if (typeof data.info !== 'object' || data.info === null) {
    return false;
  }

  if (typeof data.openapi === 'string' && data.openapi.trim().length) {
    return true;
  }

  if (typeof data.swagger === 'string' && data.swagger.trim().length) {
    return true;

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Read the console.error to find the underlying converter message.
  2. Validate the spec with a tool like Spectral or swagger-cli before importing.
  3. Inline external $refs or remove unsupported features.
  4. Update @usebruno/converters and retry.
Defensive patterns

Strategy: try-catch

Validate before calling

if (!isOpenApiSpec(data)) {
  throw new Error('Not a recognized OpenAPI spec');
}

Type guard

function isOpenApiSpec(data) {
  if (!data || typeof data !== 'object') return false;
  if (typeof data.info !== 'object' || data.info === null) return false;
  return Boolean(data.openapi || data.swagger);
}

Try / catch

try {
  convertOpenapiToBruno(data);
} catch (err) {
  console.error('Original converter error:', err);
  throw err;
}

Prevention

When it happens

Trigger: An OpenAPI spec that isOpenApiSpec accepted but the converter cannot transform: invalid OpenAPI 3.x structure, missing paths, $ref resolution failures, unsupported content types, or malformed operation definitions.

Common situations: Swagger 2.0 spec passed to an OpenAPI 3 converter, specs with external $refs that cannot be resolved, circular refs, or specs exported by tools producing non-standard extensions.

Related errors


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/3b9f5063cc06582d. Report an issue: GitHub.