Structure
Structure v1
Structure v1
  • Introduction
  • Schema concept
    • Shorthand and complete type descriptor
    • Circular reference
    • Nullable attributes
  • Coercion
    • Primitive type coercion
    • Arrays coercion
    • Generic coercion
    • Recursive coercion
    • Observations
  • Validation
    • String validations
    • Number validations
    • Boolean validations
    • Date validations
    • Array validations
    • Attribute reference
    • Nested validations
    • Validate raw data
  • Strict mode
  • Cloning an instance
  • Serialization
  • Contributing
  • License
  • GitHub
Powered by GitBook
On this page

Was this helpful?

Schema concept

The schema is an object responsible to map the attributes Structure should handle, it is the parameter of the attributes function.

attributes({
  name: String,
  age: Number
})(class User { });

There are two ways to declare an attribute of the schema, the shorthand type descriptor and the complete type descriptor.

PreviousIntroductionNextShorthand and complete type descriptor

Last updated 5 years ago

Was this helpful?