usebruno/bruno · error · Error
Invalid Swagger 2.0 specification. Failed to resolve refs.
Error message
Invalid Swagger 2.0 specification. Failed to resolve refs.
What it means
Error "Invalid Swagger 2.0 specification. Failed to resolve refs." thrown in usebruno/bruno.
Source
Thrown at packages/bruno-converters/src/openapi/swagger2-to-bruno.js:556
* Parses a Swagger 2.0 spec into a Bruno collection
* @param {Object} data - The Swagger 2.0 specification object (already resolved from JSON/YAML)
* @param {Object} options - Import options (groupBy, etc.)
* @returns {Object} Bruno collection
*/
export const parseSwagger2Collection = (data, options = {}) => {
const usedNames = new Set();
const brunoCollection = {
name: '',
uid: uuid(),
version: '1',
items: [],
environments: []
};
try {
const collectionData = resolveRefs(data, data);
if (!collectionData) {
throw new Error('Invalid Swagger 2.0 specification. Failed to resolve refs.');
}
brunoCollection.name = collectionData.info?.title?.trim() || 'Untitled Collection';
// Build server URLs from host/basePath/schemes (one environment per scheme)
const serverUrls = buildServerUrls(collectionData);
serverUrls.forEach((serverUrl, idx) => {
brunoCollection.environments.push({
uid: uuid(),
name: serverUrls.length > 1 ? `Environment ${idx + 1}` : 'Environment',
variables: [{
uid: uuid(),
name: 'baseUrl',
value: serverUrl,
type: 'text',
enabled: true,
secret: false
}]View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Bundle the Swagger 2.0 spec so all $ref pointers resolve.
- Fix or inline broken references and retry.
When it happens
Trigger: Thrown at packages/bruno-converters/src/openapi/swagger2-to-bruno.js:556 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/7cf88b36c078fcc3.
Report an issue: GitHub.