{"record":{"id":"7cf88b36c078fcc3","repo":"usebruno/bruno","slug":"invalid-swagger-2-0-specification-failed-to-resol","errorCode":null,"errorMessage":"Invalid Swagger 2.0 specification. Failed to resolve refs.","messagePattern":"Invalid Swagger 2\\.0 specification\\. Failed to resolve refs\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-converters/src/openapi/swagger2-to-bruno.js","lineNumber":556,"sourceCode":" * Parses a Swagger 2.0 spec into a Bruno collection\n * @param {Object} data - The Swagger 2.0 specification object (already resolved from JSON/YAML)\n * @param {Object} options - Import options (groupBy, etc.)\n * @returns {Object} Bruno collection\n */\nexport const parseSwagger2Collection = (data, options = {}) => {\n  const usedNames = new Set();\n  const brunoCollection = {\n    name: '',\n    uid: uuid(),\n    version: '1',\n    items: [],\n    environments: []\n  };\n\n  try {\n    const collectionData = resolveRefs(data, data);\n    if (!collectionData) {\n      throw new Error('Invalid Swagger 2.0 specification. Failed to resolve refs.');\n    }\n\n    brunoCollection.name = collectionData.info?.title?.trim() || 'Untitled Collection';\n\n    // Build server URLs from host/basePath/schemes (one environment per scheme)\n    const serverUrls = buildServerUrls(collectionData);\n    serverUrls.forEach((serverUrl, idx) => {\n      brunoCollection.environments.push({\n        uid: uuid(),\n        name: serverUrls.length > 1 ? `Environment ${idx + 1}` : 'Environment',\n        variables: [{\n          uid: uuid(),\n          name: 'baseUrl',\n          value: serverUrl,\n          type: 'text',\n          enabled: true,\n          secret: false\n        }]","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-converters/src/openapi/swagger2-to-bruno.js#L538-L574","documentation":"Error \"Invalid Swagger 2.0 specification. Failed to resolve refs.\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-converters/src/openapi/swagger2-to-bruno.js:556 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bundle the Swagger 2.0 spec so all $ref pointers resolve.","Fix or inline broken references and retry."],"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"}