Entity types
Cortex comes with several built-in entity types, but you can create unlimited custom entity types to extend your catalogs.
Every entity in the catalog is associated with an entity type. Entity type definitions require a type
and a JSON schema that outlines the attributes that entities should conform to.
JSON schema for custom entity types
Custom entity type definitions are powered by the open-source JSON Schema project.
The JSON schema for a custom entity type ensures consistency and validation when creating entities of that type. The attributes listed under required
in the schema must be defined for entities of that type according to the outlined properties
.
{
"type": "object",
"required": [
"version",
"distribution"
],
"properties": {
"version": {
"type": "string"
},
"distribution": {
"type": "string"
}
}
}
Field | Definition | Required |
---|---|---|
type | Type of entity and/or required component: array , boolean , integer , null , number , object , or string . | ✓ |
required | Required specs for the entity type | |
properties | Properties of the required specs (including type ) | (only if the required field is not null) |
Defining a JSON schema also enables visibility on an entity's detail page. The schema and the defined properties will appear under the Entity Metadata section on the Overview page, making it easy for users to identify key specs.
While JSON Schema provides many different capabilities, it is typical to keep things simple.
Custom entity types versus custom data
It is possible to create an entity type with an empty properties schema:
{
"type": "object",
"required": []
"properties": {}
}
This entity type will display in the catalogs, but entities of this type won't be validated against certain specs. Such properties can instead be defined using custom data.
A schema is ideal for enforcing static properties across all entities, while custom data allows users to easily augment and update attributes.
API
You can also create, update, and delete entity types using the Cortex API.