validate arguments value with regular expression
# File lib/apipie/params/descriptor.rb, line 129 def self.build(regexp, options, block) self.new(regexp, options) if regexp.is_a? ::Regexp end
# File lib/apipie/params/descriptor.rb, line 133 def initialize(regexp, options) super(options) @regexp = regexp end
# File lib/apipie/params/descriptor.rb, line 138 def description "Must match regular expression /#{@regexp.source}/." end
# File lib/apipie/params/descriptor.rb, line 142 def json_schema super.merge('type' => 'string', 'pattern' => @regexp.source) end