Entity.validate() is called during normalization and denormalization.
undefined indicates no error, and a string error message if there is an error.
Here we can make sure the title field is included, and of the expected type.
All fields check
Here's a recipe for checking that every defined field is present.
Another great use of validation is mixing endpoints that return incomplete objects. This is often useful when some fields consume lots of bandwidth or are computationally expensive for the backend.