Adds validation rule to this schema.

        This method returns reference to this exception to implement Builder pattern
        to chain additional calls.

        :param rule: a validation rule to be added.

        :return: this validation schema.

def with_rule(self, rule):
        """
        Adds validation rule to this schema.

        This method returns reference to this exception to implement Builder pattern
        to chain additional calls.

        :param rule: a validation rule to be added.

        :return: this validation schema.
        """
        self.rules = self.rules if self.rules != None else []
        self.rules.append(rule)
        return self