Class: OpenAPIParser::SchemaValidator::FloatValidator

Inherits:
Base
  • Object
show all
Includes:
Enumable
Defined in:
lib/openapi_parser/schema_validators/float_validator.rb

Instance Attribute Summary

Attributes inherited from Base

#validatable

Instance Method Summary collapse

Methods included from Enumable

#check_enum_include

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenAPIParser::SchemaValidator::Base

Instance Method Details

#coerce_and_validate(value, schema) ⇒ Object

validate float value by schema

Parameters:



8
9
10
11
12
13
14
# File 'lib/openapi_parser/schema_validators/float_validator.rb', line 8

def coerce_and_validate(value, schema)
  value = coerce(value) if @coerce_value

  return validatable.validate_integer(value, schema) if value.kind_of?(Integer)

  coercer_and_validate_numeric(value, schema)
end