How to use the typescript-json-schema.TJS.generateSchema function in typescript-json-schema

To help you get started, we’ve selected a few typescript-json-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse / eclipse.jdt.ls / lang-protocol-generator / Gruntfile.js View on Github external
function createJSONSchema(element, destFile) {
  var args = {
    useRef: true,
    useTypeAliasRef: false,
    useRootRef: false,
    useTitle: false,
    useDefaultProperties: false,
    disableExtraProperties: true,
    usePropertyOrder: false,
    generateRequired: true,
    out: undefined
  };
  args.out = destFile;
  var definition = TJS.generateSchema(program, element, args);
  grunt.file.write(destFile,JSON.stringify(definition, null, 4) + "\n" );
}
};