- 27 Jun 2022
- 1 Minute to read
- Updated on 27 Jun 2022
- 1 Minute to read
Schema editor is a dedicated environment for defining the Resource Schema of a Data resource. You can add, edit and delete fields your data resource can accept and pre-set the allowed types to specify the expected values. You will find yourself using the schema editor while configuring On-Device storage, creating a Firebase/Firestore connection, or creating Data Components.
Via the "ADD NEW" button you can add new entries. Upon clicking, you should be presented with a pop-up screen displaying field types to choose from.
There are six field types:
- Text - A text string
- Number - Integer or a number with a floating point
- True/False - Boolean
- List - A list of objects
- Object - A single object with an undefined quality
- Any value - Removes a strict type definition; Field can take any value
You can delete a field via clicking the "Delete" button at the bottom of its properties.
You can show an example for each property via the "Show Examples" button on the top right corner. It is always useful to verify the corectness before using a Resource.
Data Component Schema
In Data Components, schema can be fixed, requiring a certain number of fields with fixed types, or arbitrary, specifying only accepted field types and a minimum/maximum number of fields. Therefore, the schema editor differentiates in its configuration method.
Fixed Schema Editor
The Fixed schema adapter is configured the same way as the Data Resource one. Use the "Add New" button to add new entries and choose the appropriate type from the pop-up.
Arbitrary schema editor
The field configuration for an arbitrary adapter stays similar to the fixed one. It has fewer options, as an arbitrary adapter is meant to scale with the provided data. What stands out is a mandatory field for required number of fields. Here you can limit the amount of fields that an adapter can take by setting the 'Maxium' value.