Skip to content

Turning on JSON Schema Generation

Alexey Valikov edited this page Apr 27, 2015 · 1 revision

Turning on JSON Schema generation

You can turn on JSON Schema generation with one of the following options:

  • Use -generateJsonSchema or -Xjsonix-generateJsonSchema command line options or XJC plugin arguments.
  • Alternatively add <jsonix:jsonSchema .../> to your configuration on the top level or within <jsonix:module .../> configuration elements.

Command-line example

java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar
  -d mappings
  -b bindings 

Bindings example

<jsonix:module name="PurchaseOrder">
	<jsonix:mapping name="PO" package="org.hisrc.jsonix.demos.po" schemaId="PurchaseOrder.jsonschema#"/>
	<jsonix:output naming="standard" fileName="${}.standard.js"/>
	<jsonix:output naming="compact" fileName="${}.compact.js"/>

See this demo project, specifically bindings.xjb.

Clone this wiki locally
You can’t perform that action at this time.