Description

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.


GenRocket's JSON DDL Schema is clean, simple, and contains only the necessary elements to quickly define table definitions to include: 

  • table names
  • column names
    • dataTypes
    • maxLength
    • nullability
    • required
  • metadata
    • hints
    • observable characters
    • maxCharLength
    • minCharLength
    • maxValue
    • minValue
  • primary keys
  • foreign keys 

 

GenRocket's DDL JSON Schema enables importing the many different and evergrowing JSON formats into the platform and successfully turning those formats into concrete Domains with Attributes, Generators with Parent/Child Relationships.


See Example Usage 

GenRocket DDL JSON Schema of Card Product Table


Grid View of GenRocket's DDL JSON Schema

The image below shows a grid view of GenRocket's DDL JSON Schema.


GenRocket's DDL JSON Schema

The JSON Schema below defines GenRocket's DDL

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://example.com/product.schema.json",
    "title": "GenRocket JSON DDL Import Schema",
    "description": "Defines a DDL in JSON for GenRocket Import",
    "type": "array",
    "properties": {
        "name": {
            "description": "The unique identifier of the entity",
            "type": "string"
        },
        "columns": {
            "type": "array",
            "properties": {
                "name": {
                    "description": "The unique identifier of the column",
                    "type": "string"
                },
                "type": {
                    "type": "object",
                    "properties": {
                        "datatype": {
                            "description": "Defines the data type of the column",
                            "type": "string"
                        },
                        "maxLength": {
                            "description": "Defines the maximum length of the column",
                            "type": "string"
                        },
                        "nullable": {
                            "description": "Defines whether the column is required",
                            "type": "Boolean"
                        },
                        "required": [
                            "datatype",
                            "nullable"
                        ]
                    }
                },
                "metadata": {
                    "type": "object",
                    "properties": {
                        "hint": {
                            "description": "Helps classify the name. Think of it as a hint",
                            "type": "string"
                        },
                        "observedCharacters": {
                            "description": "Defines a set of characters that were observed",
                            "type": "string"
                        },
                        "maxCharLength": {
                            "description": "Defines a metadata maximum number of characters",
                            "type": "int"
                        },
                        "minCharLength": {
                            "description": "Defines a metadata minimum number of characters",
                            "type": "int"
                        },
                        "maxValue": {
                            "description": "Defines a metadata maximum value",
                            "type": "int"
                        },
                        "minValue": {
                            "description": "Defines a metadata minimum value",
                            "type": "int"
                        },
                        "required": [
                        ]
                    }
                }
            },
            "required": [
                "name",
                "type"
            ]
        },
        "primaryKey": {
            "type": "array",
            "properties": {
                "column": {
                    "description": "Defines the a unique column name",
                    "type": "string"
                },
                "required": ["column"]
            }
        },
        "foreignKeys": {
            "type": "array",
            "properties": {
                "column": {
                    "description": "Defines the a unique column name",
                    "type": "string"
                },
                "name": {
                    "description": "Defines the related entity name",
                    "type": "string"
                },
                "foreignColumn": {
                    "description": "Defines the name of the foreign column",
                    "type": "string"
                }
            },
            "required": [
                "column",
                "name"
            ]
        }
    },
    "required": [
        "name",
        "columns",
        "primaryKey"
    ]
}