Schema Providers

How to provide schemas from model constructors

This way of defining schemas is particularly useful when dealing with recursive models (see Recursive Schemas for an example).

To create a schema provider, the class or constructor function must provide a static getRevivalSchema function.

This way, when reviving a model using revive(json, Employee) the schema provided by the Employee class will be used.

Last updated

Was this helpful?