Sha256: b6bbebba32dfc564a12dc140c33169f89fa1297aef250cd4f33b677965e8ec08

Contents?: true

Size: 249 Bytes

Versions: 5

Compression:

Stored size: 249 Bytes

Contents

# frozen_string_literal: true

module Openapi3Parser
  module Validators
    class Url
      def self.call(input)
        URI.parse(input) && nil
      rescue URI::InvalidURIError
        %("#{input}" is not a valid URL)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
openapi3_parser-0.10.1 lib/openapi3_parser/validators/url.rb
openapi3_parser-0.9.2 lib/openapi3_parser/validators/url.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/openapi3_parser-0.9.1/lib/openapi3_parser/validators/url.rb
openapi3_parser-0.9.1 lib/openapi3_parser/validators/url.rb
openapi3_parser-0.9.0 lib/openapi3_parser/validators/url.rb