Attributes
You can think of an attribute as a MySQL Column, an Elasticsearch Field, etc.
In a manifest, each model can have multiple attributes defined within it and each attribute is defined as an object with key as the attribute ID and value as the attribute definition.
Example
Attributes example | |
---|---|
-
Definition of an Attribute with ID
an_attribute
. View Attribute Reference for details. -
Definition of an Attribute with ID
another_attribute
. View Attribute Definition for details.
Fields
-
attributes
(object) [required]Manifest path:
$.models[*].attributes
This object is a container for all attribute definitions for a model. Each attribute is defined within the
attributes
object of a model and the keys act as their IDs.Accepted values for keys / Attribute IDs are represented by the following regex:
^[A-Za-z]+[A-Za-z0-9_\-]
i.e, it should start with an alphabetical character and can be followed by any number of alpha-numeric characters, hyphens, or underscores.
In-line vs referenced definition
An attribute can either be defined in-line in the manifest or in a separate file. Although we recommend spreading model and datastore definitions across different files, whether to move an attribute definition to a different file can be quite subjective. We recommend you take the call based on what seems more readable for you.
- Attribute Definition (when defining the attribute in-line)
- Attribute Reference (when defining the attribute in a separate file)