EA JSON

EA JSON is an add-in for Sparx Enterprise Architect that enables you to model and generate JSON Schemas.

You can model JSON schemas in class diagrams with the JSON toolbox. Each of the JSON specific elements has custom properties specific to JSON schema items.

From a JSON Schema model you can then generate the JSON Schema file.

Download

Installation

EA Mapping is part of the Bellekens EA Toolpack which includes other useful add-ins such as

When installing you can choose which of the tools you wish to install.

Usage

Create JSON model

Create a new JSON diagram by selecting the JSON diagram type.

Then use the toolbox to add classes, attributes, datatypes and enumerations.

The Schema item represents the schema itself. Add Attributes as properties of your schema, or use Elements to model objects JSON object types.

Use the custom JSON properties to fill in constraints of your elements, datatypes and attributes

Generate JSON Schema file

Once the JSON schema has been modelled you can generate the JSON Schema file.

Right click on the JSON Schema element and choose the option
Specialize | EA JSON | Generate JSON Schema

If this is the first time you are generating a schema file for this element you will be prompted for a filename.

When you select this option on a package, the add-in will generate all JSON Schema’s in this package and sub-packages.

Transform from class diagram

Using the option Specialize | EA JSON | Generate JSON Schema on a package will transform a package with regular classes into JSON classes.

You will be asked to select an optional root element which will be used as the JSON Schema element.

The transformation includes a transformation from XSD schema oriented datatypes and facets to the JSON Schema model.