Sha256: fa71f5b94e824d2d23a59892979d2219615c93779d3620baac0a9207a213ba3c

Contents?: true

Size: 486 Bytes

Versions: 12

Compression:

Stored size: 486 Bytes

Contents

# validate AllOf schema
class OpenAPIParser::SchemaValidator
  class AllOfValidator < Base
    # coerce and validate value
    # @param [Object] value
    # @param [OpenAPIParser::Schemas::Schema] schema
    def coerce_and_validate(value, schema)
      # if any schema return error, it's not valida all of value
      schema.all_of.each do |s|
        _coerced, err = validatable.validate_schema(value, s)
        return [nil, err] if err
      end
      [value, nil]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openapi_parser-0.2.7 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.6 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.5 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.4 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.3 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.2 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.1 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.2.0 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.1.9 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.1.8 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.1.7 lib/openapi_parser/schema_validators/all_of_validator.rb
openapi_parser-0.1.6 lib/openapi_parser/schema_validators/all_of_validator.rb