To create a JSON Schema file of your entity, choose the menu Tools > Forward Engineering > JSON Schema:
then select the directory path and file name.
The JSON Schema for the entity can also be viewed in the left-hand pane of the JSON Preview tab:
Several important options are available:
1) JSON Schema compliance:
- standard: only JSON Schema keywords and data types are used -- this output should pass validation with standard validators
- full: custom keywords are also listed for a full view of the schema, but only standard JSON data types are used -- this output should pass validation as long as additionalProperties are set to true
- extended: data types are specific to the target of the model, plus internal properties and keywords are also listed.
Important note: in extended compliance, it is normal that the exported JSON Schema does not pass the test of validators. This is because data types used for a given target may be non-JSON data types. For example ObjectId for MongoDB, or UUID in Cassandra, etc...
2) JSON Schema specification:output is dynamically adapted to the selected specification:
- referenced: definitions are referenced as described in the model, using $ref syntax
- resolved:: definitions are resolved to list the content of the reference.
- internal: references to external and model definitions are converted into internal definitions