code: function generateDefinitions(schemataObj, options, cb) {
  
    options.templateData = assign({}, defaults.templateData, options.templateData || {});
    options = assign({}, defaults, options);
  
    // Allow user to pass in a template function or a file path.
    if (!options.templateFn && options.templatePath) {
      if (!templateCache[options.templatePath]) {
        templateCache[options.templatePath] = ejs.compile(fs.readFileSync(options.templatePath).toString('utf8'));
      }
      options.templateFn = templateCache[options.templatePath];
    }
  
    var results;
    try {
      results = generateAllResults(schemataObj, options);
    } catch (e) {
      return process.nextTick(function() { cb(e); }); // don't release zalgo
    }
    if (options.targetPath) {
      writeAllResults(results, options, cb);
    } else {
      process.nextTick(function() { cb(null, results); });
    }
  }
docs: This expects an object containing model definitions conforming to the Swagger spec. On a typical swagger.json this would be the 'definitions' key. See test/ for an example. On callback, if there is an error, it's either a template generation error or a file writing error.