createSchema = (schema) => {
  const next = { ...schema };

  next.nodes ||= [];
  next.links ||= [];

  next.nodes.forEach(ensureNodeId);

  validateSchema(next);

  return next;
}
takes a schema draft and ensure it is a valid schema