Sha256: 561d647316be94760f2e067d1fae661322baf660f738612abcf906b2f8c7e74e

Contents?: true

Size: 376 Bytes

Versions: 6

Compression:

Stored size: 376 Bytes

Contents

# frozen_string_literal: true
module JSONSchemer
  module OpenAPI30
    module Vocab
      module Base
        class Type < Draft4::Vocab::Validation::Type
          def parse
            if schema.value['nullable'] == true
              (Array(value) + ['null']).uniq
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
json_schemer-2.3.0 lib/json_schemer/openapi30/vocab/base.rb
json_schemer-2.2.1 lib/json_schemer/openapi30/vocab/base.rb
json_schemer-2.2.0 lib/json_schemer/openapi30/vocab/base.rb
json_schemer-2.1.1 lib/json_schemer/openapi30/vocab/base.rb
json_schemer-2.1.0 lib/json_schemer/openapi30/vocab/base.rb
json_schemer-2.0.0 lib/json_schemer/openapi30/vocab/base.rb