Skip to content
highsource edited this page Mar 26, 2015 · 5 revisions

NPM usage

The Jsonix Schema Compiler package on NPM includes the schema compiler (under lib/jsonix-schema-compiler-full.jar). So you can invoke the schema compiler via command line as follows:

java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar schema.xsd

Typical usage is as follows:

  • Make your package depend on jsonix-schema-compiler.
  • Invoke the Jsonix Schema Compiler in scripts/prepublish.

Example

{
	"name": "mypackage",
	...
	"dependencies": {
		...
		"jsonix": "<VERSION>",
		"jsonix-schema-compiler": "<VERSION>"
		...
	},
	...
	"scripts": {
		...
		"prepublish" : "java -jar node_modules/jsonix/lib/jsonix-schema-compiler-full.jar schema.xsd"
		...
	}
	...
}
Clone this wiki locally