Skip to Content
Docs

Examples

The Data Schema is the essence of your Object Type. Created using JSON, Data Schemas can be as simple or complex as your needs demand. Several examples of this powerful Contextual capability are provided.

An example of a Customer Object Type typical to a simple business or CRM system.

Object Type Definition Value
ID customer
Display Name Customer
Display Name (Plural) Customers
Description Customers of my company.
Category Data
Example Data Schema
{
  "primaryKey": "customerId",
  "type": "object",
  "properties": {
    "customerId": {
      "type": "string",
      "generate": {
        "type": "uuid",
        "format": "v4"
      }
    },
    "firstName": {
      "type": "string",
      "minLength": 1
    },
    "lastName": {
      "type": "string",
      "minLength": 1
    },
    "email": {
      "type": "string",
      "format": "email",
      "minLength": 1
    },
    "phone": {
      "type": "string",
      "minLength": 1
    },
    "address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string",
          "minLength": 1
        },
        "city": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "type": "string",
          "minLength": 1
        },
        "zip": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "street",
        "city",
        "state",
        "zip"
      ]
    }
  },
  "required": [
    "firstName",
    "lastName",
    "email",
    "phone",
    "address"
  ],
  "additionalProperties": false
}

This schema defines an object for storing customer data, using customerId as the primary key, which is generated as a UUID version 4 string. The schema includes properties such as firstName, lastName, email (which must be a valid email format), and phone, each requiring a minimum length of one character. It also details an address object with mandatory properties like street, city, state, and zip, each also requiring a minimum length of one. All these properties are required for the object to be valid. Additionally, the schema disallows any properties not explicitly defined (additionalProperties is set to false).