Sha256: d5ba9b92a150d1ed0135cc4d5ff736218fb39592d1102e87a06af7554f03ced2

Contents?: true

Size: 321 Bytes

Versions: 15

Compression:

Stored size: 321 Bytes

Contents

# frozen_string_literal: true

module Openapi3Parser
  module Validators
    class AbsoluteUri
      def self.call(input)
        uri = URI.parse(input)
        %("#{input}" is not a absolute URI) unless uri.absolute?
      rescue URI::InvalidURIError
        %("#{input}" is not a valid URI)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
openapi3_parser-0.10.1 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.9.2 lib/openapi3_parser/validators/absolute_uri.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/openapi3_parser-0.9.1/lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.9.1 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.9.0 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.8.2 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.8.1 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.8.0 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.7.0 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.6.1 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.6.0 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.5.2 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.5.1 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.5.0 lib/openapi3_parser/validators/absolute_uri.rb
openapi3_parser-0.4.0 lib/openapi3_parser/validators/absolute_uri.rb