{"record":{"id":"1f723336fbf2f59a","repo":"usebruno/bruno","slug":"invalid-openapi-collection-failed-to-resolve-refs","errorCode":null,"errorMessage":"Invalid OpenAPI collection. Failed to resolve refs.","messagePattern":"Invalid OpenAPI collection\\. Failed to resolve refs\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-converters/src/openapi/openapi-to-bruno.js","lineNumber":808,"sourceCode":"    // could use https://www.npmjs.com/package/json-pointer for better support\n    return `res.body${pointer.replace('/', '.')}`;\n  }\n  return expression;\n};\n\nexport const parseOpenApiCollection = (data, options = {}) => {\n  const usedNames = new Set();\n  const brunoCollection = {\n    name: '',\n    uid: uuid(),\n    version: '1',\n    items: [],\n    environments: []\n  };\n  try {\n    const collectionData = resolveRefs(data);\n    if (!collectionData) {\n      throw new Error('Invalid OpenAPI collection. Failed to resolve refs.');\n      return;\n    }\n\n    // Currently parsing of openapi spec is \"do your best\", that is\n    // allows \"invalid\" openapi spec\n\n    brunoCollection.name = collectionData.info?.title?.trim() || 'Untitled Collection';\n\n    let servers = collectionData.servers || [];\n\n    // Create environments based on the servers. A server's name or description is free text\n    // that becomes the environment's filename, so it needs the same normalization as an\n    // operation name. It also needs a uniqueness guard: unlike requests, environments have\n    // no deduplication, so two servers described alike resolve to one file and the later\n    // one overwrites the earlier.\n    const usedEnvironmentNames = new Set();\n    servers.forEach((server, index) => {\n      const serverLabel = server.name || server.description;","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-converters/src/openapi/openapi-to-bruno.js#L790-L826","documentation":"Error \"Invalid OpenAPI collection. Failed to resolve refs.\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-converters/src/openapi/openapi-to-bruno.js:808 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bundle the OpenAPI spec so all $ref references resolve (e.g. with swagger-cli bundle).","Ensure referenced external files are present and paths are correct."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}