Sha256: 264087a89c7619d03f325850d212655517a50b368bcf2d7b7471850c6cd11609

Contents?: true

Size: 297 Bytes

Versions: 4

Compression:

Stored size: 297 Bytes

Contents

class OpenAPIParser::SchemaValidator
  module Enumable
    def check_enum_include(value, schema)
      return [value, nil] unless schema.enum
      return [value, nil] if schema.enum.include?(value)

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openapi_parser-0.1.6 lib/openapi_parser/schema_validators/enumable.rb
openapi_parser-0.1.5 lib/openapi_parser/schema_validators/enumable.rb
openapi_parser-0.1.4 lib/openapi_parser/schema_validators/enumable.rb
openapi_parser-0.1.3 lib/openapi_parser/schema_validators/enumable.rb