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

Error "The Collection has an invalid schema: ${err.message}" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-converters/src/common/index.js:120

export const sanitizeTags = (tags, options = {}) => {
  if (!Array.isArray(tags)) {
    return [];
  }

  return [...new Set(
    tags
      .map((tag) => sanitizeTag(tag, options))
      .filter((tag) => tag !== null)
  )];
};

export const validateSchema = (collection = {}) => {
  try {
    collectionSchema.validateSync(collection);
    return collection;
  } catch (err) {
    console.log('Error validating schema', err);
    throw new Error(`The Collection has an invalid schema: ${err.message}`);
  }
};

export const updateUidsInCollection = (_collection) => {
  const collection = cloneDeep(_collection);

  collection.uid = uuid();

  const updateItemUids = (items = []) => {
    each(items, (item) => {
      item.uid = uuid();

      each(get(item, 'request.headers'), (header) => (header.uid = uuid()));
      each(get(item, 'request.params'), (param) => (param.uid = uuid()));
      each(get(item, 'request.vars.req'), (v) => (v.uid = uuid()));
      each(get(item, 'request.vars.res'), (v) => (v.uid = uuid()));
      each(get(item, 'request.assertions'), (a) => (a.uid = uuid()));
      each(get(item, 'request.body.multipartForm'), (param) => (param.uid = uuid()));

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Fix the collection structure per the reported schema error message.
  2. Validate the collection JSON against the expected schema before converting.

When it happens

Trigger: Thrown at packages/bruno-converters/src/common/index.js:120 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/50604aa73570b23c. Report an issue: GitHub.