def register_format(self, user_defined_format): """Registers a user-defined format to be used with this spec. :type user_defined_format: :class:`bravado_core.formatter.SwaggerFormat` """ name = user_defined_format.format self.user_defined_formats[name] = user_defined_format validate = return_true_wrapper(user_defined_format.validate) self.format_checker.checks(name, raises=(SwaggerValidationError,))(validate)
def register_format(self, user_defined_format): """Registers a user-defined format to be used with this spec. :type user_defined_format: :class:`bravado_core.formatter.SwaggerFormat` """ name = user_defined_format.format self.user_defined_formats[name] = user_defined_format validate = return_true_wrapper(user_defined_format.validate) self.format_checker.checks( name, raises=(SwaggerValidationError,))(validate)