Class: OpenAPIParser::SchemaValidator::IntegerValidator
- Includes:
- Enumable
- Defined in:
- lib/openapi_parser/schema_validators/integer_validator.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#coerce_and_validate(value, schema, **_keyword_args) ⇒ Object
validate integer value by schema.
Methods included from Enumable
Methods inherited from Base
#initialize, #validate_discriminator_schema
Constructor Details
This class inherits a constructor from OpenAPIParser::SchemaValidator::Base
Instance Method Details
#coerce_and_validate(value, schema, **_keyword_args) ⇒ Object
validate integer value by schema
8 9 10 11 12 13 14 |
# File 'lib/openapi_parser/schema_validators/integer_validator.rb', line 8 def coerce_and_validate(value, schema, **_keyword_args) value = coerce(value) if @coerce_value return OpenAPIParser::ValidateError.build_error_result(value, schema) unless value.kind_of?(Integer) check_enum_include(value, schema) end |