Fields are the most important part of each entity. They describe the properties an entity holds and they can be of different types, from primitive ones (like strings, or integers) to complex like nested object, references or arrays.
Each field has the following properties, some required like the name and the type and some are optional like the displayName and the required field.
The name of the field. It is gonna to be used in all the Gemini framework, also with low level APIs in order to build the JSON properties and identify the field.
The data type for the field
true or false to specify if the field is required when you insert or update the record or not. Default is false.
If you want a different display name, especially for the GUI parts.
For example lets see a Product entity where the fields id, name and price are required.
- name: id
- name: name
- name: price
- name: salePrice
displayName: Sale Price
displayName is useful for the frontend part. Using this field you can indicate a display name for the field label (for example in a form or in table) that is different from the label used inside JSON and APIs.
Each field may contains its own configuration, especially complex fields like nested object, arrays, foreign keys and so on.