Sha256: 1e5594bb8561d63c107868a72a58fae6fe08c6789a57c4b2d9ab63d49dd1d40e

Contents?: true

Size: 340 Bytes

Versions: 28

Compression:

Stored size: 340 Bytes

Contents

class OpenAPIParser::SchemaValidator
  class NilValidator < Base
    # @param [Object] value
    # @param [OpenAPIParser::Schemas::Schema] schema
    def coerce_and_validate(value, schema, **_keyword_args)
      return [value, nil] if schema.nullable

      [nil, OpenAPIParser::NotNullError.new(schema.object_reference)]
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
openapi_parser-2.2.2 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser-2.2.1 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser-2.2.0 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser-2.1.0 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser-2.0.0 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser_firetail-1.0.0 lib/openapi_parser/schema_validator/nil_validator.rb
openapi_parser-1.0.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-1.0.0.beta1 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.15.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.14.1 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.14.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.13.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.12.1 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.12.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.11.2 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.11.1 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.11.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.10.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.9.0 lib/openapi_parser/schema_validators/nil_validator.rb
openapi_parser-0.8.0 lib/openapi_parser/schema_validators/nil_validator.rb