Documentation

Data Schema

Define a new data type

2 min read

A Data Schema defines the shape of data — which fields it is made of, and what type each field is.

For example, in a to-do app, you might define a single to-do like this.

  • title — string
  • done — boolean
  • dueDate — string

The Todo Schema defined this way becomes a new data type. You can then create data of the Todo type, or create an array of Todo.

Creating a Schema

In the Data Scheme list in the left panel, add a new Schema and add fields one by one. For each field, specify a name and a type.

If you choose reference as the field type, you can reference another Schema. For example, by adding an owner field inside Todo that references the User Schema, you can build interconnected data structures.

Importing schemas

If you already have a defined data structure, you can import it instead of building it by hand. When you import a JSON Schema file or a server API's OpenAPI/Swagger spec, the data structures are automatically generated as Schemas.

A Schema is the shape and Data is the value. Remember the flow: first define the type with a Schema, then create data of that type and fill in the values.