Description

A JSON Schema is a standard format that defines what JSON data is required by an application and how to handle that data. It also provides a standard way to structure metadata. This feature supports various metadata management applications such as Ab Initio. 


Because there are so many ways to describe data models using JSON, it is not practical for GenRocket to implement code for each of them. So, using JSON's Schema Definition Language, GenRocket has defined a JSON Data Definition Language (DDL) as a standard for clients to funnel their JSON formats into GenRocket's JSON Schema.


To import Domains using a GenRocket DDL Import Schema, users can use the Import from GenRocket JSON Schema option within the New Domain drop-down menu in the Project Dashboard.


In This Article


GenRocket DDL JSON Schema Information

Please see these articles for more information about GenRocket DDL JSON Schema: 


Sample GenRocket JSON DDL Schema File for Import

This file creates 3 Domains: User, Address, and Account.

  • User Domain Attributes -> id, first_name, last_name, middle_init, date_created
  • Address Domain Attributes -> id, city, state, zip, user_id (foreign key)
  • Account Domain Attributes -> id, ssn, username, password, user_id (foreign key)

The User Domain is the Parent of the Address and Account Domains. For each Domain, the id Attribute is the Primary Key.


Important: Below, we have included a snippet of the file used for this import. The entire file has been attached to this article and can be downloaded to your local machine.

[
  {
    "name": "user",
    "columns": [
      {
        "name": "id",
        "type": {
          "datatype": "bigint",
          "maxLength": "11",
          "nullable": false
        },
        "metadata": {
          "hint": "user Id",
          "observedCharacters": "",
          "maxValue": "100000",
          "minValue": "100"
        }
      },
      {
        "name": "first_name",
        "type": {
          "datatype": "varchar",
          "maxLength": "255",
          "nullable": false
        },
        "metadata": {
          "hint": "First Name",
          "observedCharacters": "",
          "maxValue": "",
          "minValue": ""
        }
      },
      {
        "name": "last_name",
        "type": {
          "datatype": "varchar",
          "maxLength": "255",
          "nullable": false
        },
        "metadata": {
          "hint": "Last Name",
          "observedCharacters": "",
          "maxValue": "",
          "minValue": ""
        }
      },


How to Import a GenRocket JSON DDL Schema

  • In the Project Dashboard, select the Project and Project Version.



  • Expand the New Domain Menu in the Domains Pane and select Import from GenRocket JSON Schema.



  • Click on Choose File to browse to and select the JSON Schema file.



  • The selected file's name will appear to the right of the Choose File button.

  • Click Save to start the import.



  • Click OK to close.



  • The JSON Schema import will appear in Queue Status Pane within the Project Dashboard.



  • The Domains and Attributes will be created automatically within the selected Project Version, as shown below:


GenRocket JSON DDL Schema Import Results

The following section shows the import results of the JSON Schema file used for this import example:

User Domain

The User Domain contains the five Attributes defined within the JSON Schema file used for the import.



The JSON File defines the minValue for the id Attribute as 100.  



As defined in the file, the id Attribute begins at 100. 



Address Domain

The Address Domain contains the five Attributes defined within the JSON Schema file used for the import. 



Account Domain

The Account Domain contains the five Attributes defined within the JSON Schema file used for the import.


Parent/Child Relationships

User Domain is the parent of both the Address and Account Domains. 



Attribute Information

Below is the portion of the file that defines the firstName Attribute for the User Domain. The Data Type and Max Length information can be seen in the Attribute Dashboard.



Next Steps After Import

For larger imports with many Domains, XTS Wizard can be used to set Parent/Child Relationships between Domains, perform Generator Tuning, batch assign Receivers, and batch add Scenarios. Please see this article to learn more: How to import XTS Files using XTS Wizard.