Learning Center

Learning Center

Learn Menu

Validation

We almost always have to validate string data, such as username, email etc. So why not just incorporate the data validation into our data models and generate the code that already knows how to validate data?

OneGen supports validation of string and string? data types. The validation is based on regular expressions.

Validation

Validation example

  • Select or create a class
  • Select or create a property with string or string? data type
  • Click on the validation icon next to the data type field
  • Enter a simple validation regex (allowing only alphanumeric characters): [a-zA-Z0-9]+
  • Enter a message for the user in case validation fails: Only alphanumeric characters are allowed!

We use cookies to track activity using Google Analytics & reCAPTCHA. It helps us understand what our visitors like about our product and how they interact with our website. For more information, check out our Privacy Policy.