Nested Schema

A basic schema is an object where every value is either:

These can be nested within objects to create nested schema.

const countrySchema = {
name: Schema.string,
continent: Schema.enum(['Asia', 'Africa', 'Europe', 'Australia', 'North America', 'South America', 'Antarctica']),
population: Schema.number
capital: {
name: Schema.string,
population: Schema.number
}
}
class Country extends ActiveClass(countrySchema) {}