usebruno/bruno · error · Error
sourceUrl is required to update openapi sync config
Error message
sourceUrl is required to update openapi sync config
What it means
Error "sourceUrl is required to update openapi sync config" thrown in usebruno/bruno.
Source
Thrown at packages/bruno-electron/src/ipc/openapi-sync.js:1697
});
// Update OpenAPI sync configuration (e.g., source URL)
ipcMain.handle('renderer:update-openapi-sync-config', async (event, { collectionPath, config }) => {
try {
const { format, brunoConfig, collectionRoot } = loadBrunoConfig(collectionPath);
// Merge new config into existing entry (allowlist keys only)
const allowedKeys = ['sourceUrl', 'groupBy', 'lastSyncDate', 'specHash', 'autoCheck', 'autoCheckInterval'];
const sanitizedConfig = {};
for (const key of allowedKeys) {
if (key in config) {
sanitizedConfig[key] = config[key];
}
}
// sourceUrl is required — it identifies which entry to create/update
if (!sanitizedConfig.sourceUrl) {
throw new Error('sourceUrl is required to update openapi sync config');
}
// Validate sourceUrl — reject protocol-based non-http(s) URLs (e.g. ftp://, file://)
if (sanitizedConfig.sourceUrl.includes('://') && !isValidHttpUrl(sanitizedConfig.sourceUrl)) {
throw new Error('Invalid URL: only http and https URLs are allowed');
}
// Resolve to absolute for consistent internal handling (saveBrunoConfig converts back to relative)
sanitizedConfig.sourceUrl = resolveSourceUrl(collectionPath, sanitizedConfig.sourceUrl);
// Update or create the single openapi entry
const existingEntry = brunoConfig.openapi?.[0];
if (existingEntry) {
brunoConfig.openapi = [{ ...existingEntry, ...sanitizedConfig }];
} else {
if (!('autoCheck' in sanitizedConfig)) sanitizedConfig.autoCheck = true;
if (!('autoCheckInterval' in sanitizedConfig)) sanitizedConfig.autoCheckInterval = 5;
brunoConfig.openapi = [sanitizedConfig];View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Provide the sourceUrl of the remote OpenAPI spec when updating the sync config.
When it happens
Trigger: Thrown at packages/bruno-electron/src/ipc/openapi-sync.js:1697 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/d166eea71427aed8.
Report an issue: GitHub.