Skip to main content

@versionzero/schema / types / ISchemaOptionsCommon

Interface: ISchemaOptionsCommon

Defined in: src/types.js:37

Properties

PropertyTypeDescription
type?SchemaFundamentalTypeshould only be set on the core types supported by the schema
compileHook?(arg0, arg1) => voida function called during schema compilation
allowEmpty?booleanwhether an array type or string type can be empty
allowUndefined?booleanwhether undefined values can be passed through this schema
allowErrors?booleanwhether to throw when a processor returns an Error, or treat it as a legal value
strict?booleanwhether to do strict typechecking (defaults to true; must be explicitly false to be "lax")
reference?booleandisallow direct assignment; value will be inherited from a parent
required?booleanflag indicating whether this field is required
literal?booleanflag indicating that this field always returns the option value
implicit?booleanflag indicating that this field exists implicitly in the post-transform value
dynamic?booleantrue/undefined means treat functional values as dynamic lookups; false means treat functions as values
context?stringtriggers value to be copied to the context field with this name
default?anydefault value
values?any[]list of legal input values for this field
selector?booleantrue if this schema acts as a selector
selection?string | booleanthis schema activates if the selector matches the value, or matches this prop name if true