usebruno/bruno · error · Error
The Collection has an invalid schema: ${err.message}
Error message
The Collection has an invalid schema: ${err.message} What it means
Thrown by validateSchema (inlined in wsdl-to-bruno.js from src/common) when collectionSchema.validateSync rejects the produced Bruno collection. This is a Yup schema validation: the WSDL→Bruno translation produced a collection whose shape does not match @usebruno/schema's collectionSchema. The original Yup error message (field path + rule) is appended.
Source
Thrown at packages/bruno-converters/src/wsdl/wsdl-to-bruno.js:20
const generateUID = () => {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < 21; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
};
import { get, each } from 'lodash';
import { collectionSchema } from '@usebruno/schema';
// --- Inlined from src/common/index.js ---
export const validateSchema = (collection = {}) => {
try {
collectionSchema.validateSync(collection);
return collection;
} catch (err) {
throw new Error('The Collection has an invalid schema: ' + err.message);
}
};
export const transformItemsInCollection = (collection) => {
const transformItems = (items = []) => {
each(items, (item) => {
if (['http', 'graphql'].includes(item.type)) {
item.type = `${item.type}-request`;
if (item.request.query) {
item.request.params = item.request.query.map((queryItem) => ({
...queryItem,
type: 'query',
uid: queryItem.uid || generateUID()
}));
}
delete item.request.query;
let multipartFormData = get(item, 'request.body.multipartForm');
if (multipartFormData) {View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Read the appended err.message — Yup reports the exact failing path (e.g. 'items[0].request must be defined').
- Ensure wsdlToBruno and @usebruno/schema are at compatible versions (check the package's dependency range).
- Inspect the pre-validation `hydratedCollection` (log it before line 20) to find the malformed node.
Example fix
// before
const validated = validateSchema(hydrated);
// after — log the offender
try {
return validateSchema(hydrated);
} catch (e) {
console.error('schema reject on collection:', JSON.stringify(hydrated, null, 2));
throw e;
} Defensive patterns
Strategy: validation
Validate before calling
import { collectionSchema } from '@usebruno/schema';
const precheck = (col) => {
try { collectionSchema.validateSync(col); return true; }
catch (e) { console.warn('schema precheck:', e.message); return false; }
}; Type guard
const hasRequiredCollectionFields = (c) => !!c && typeof c.name === 'string' && Array.isArray(c.items) && !!c.uid;
Try / catch
try {
return validateSchema(col);
} catch (e) {
console.error('offending collection:', JSON.stringify(col, null, 2));
throw e;
} Prevention
- Keep @usebruno/schema and bruno-converters at compatible versions.
- Log the hydrated collection before validation to locate the malformed node.
- Read the Yup message — it reports the exact failing path.
When it happens
Trigger: A WSDL whose translation yields a collection missing required fields (uid, name, items), with items of wrong type, or carrying fields the schema marks as unknown/noUnknown. Common after a @usebruno/schema version change that tightened rules.
Common situations: Schema/bruno-oauth or items[].type mismatches; WSDL parser emitting a request type the schema doesn't allow; outdated @usebruno/schema; extra fields from parseWSDLCollection that the strict schema rejects.
Related errors
- No definitions found in WSDL
- Import WSDL collection failed: ${err.message}
- Import collection failed
- Unable to parse the postman environment json file
- Unsupported Postman schema version. Only Postman Collection
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/8c2aa4f0a69faf06.
Report an issue: GitHub.