Data model
September 15, 2018 ยท View on GitHub
The data model is specified using configuration properties.
This includes the list of collections, attributes and their relations to each other.
collections:
users:
description: User of the API
attributes:
id:
type: string
age:
type: integer
reports:
type: reports[]
reports:
attributes:
id:
type: string
content:
type: string
Data model logic
Logic related to the data model can be specified for each collection and attribute, including:
- who is authorized to read or write each model
- readonly attributes
- data validation
- default values
- computing and transforming attributes
- aliasing attibute names
- custom patch operators to handle model updates
collections:
users:
authorize:
user_group: admin
attributes:
age:
type: integer
score:
type: number
alias: high_score
default: 10
validate:
minimum: 20