Throws validation error for serialization