Required fields and default values (#5835)
* Add field options to mongo schema metadata * Add/fix test with fields options * Add required validation failing test * Add more tests * Only set default value if field is undefined * Fix redis test * Fix tests * Test for creating a new class with field options * Validate default value type * fix lint (weird) * Fix lint another way * Add tests for beforeSave trigger and solve small issue regarding the use of unset in the beforeSave trigger
This commit is contained in:
committed by
GitHub
parent
d3810c2eba
commit
fd637ff4f8
@@ -5,6 +5,8 @@ export type LoadSchemaOptions = {
|
||||
export type SchemaField = {
|
||||
type: string,
|
||||
targetClass?: ?string,
|
||||
required?: ?boolean,
|
||||
defaultValue?: ?any,
|
||||
};
|
||||
|
||||
export type SchemaFields = { [string]: SchemaField };
|
||||
|
||||
Reference in New Issue
Block a user