Sha256: 205abfd433068f09f6ddc3f3b3ac68d5a961776b719a52d8e089078c7aac79b5
Contents?: true
Size: 713 Bytes
Versions: 130
Compression:
Stored size: 713 Bytes
Contents
module Kontena::Cli::Stacks::YAML::Validations::CustomValidators class ExtendsValidator < HashValidator::Validator::Base def initialize super('stacks_valid_extends') end def validate(key, value, validations, errors) unless value.is_a?(String) || value.is_a?(Hash) errors[key] = 'extends must be string or hash' return end if value.is_a?(Hash) extends_validation = { 'service' => 'string', 'file' => HashValidator.optional('string'), 'stack' => HashValidator.optional('string') } HashValidator.validator_for(extends_validation).validate(key, value, extends_validation, errors) end end end end
Version data entries
130 entries across 130 versions & 2 rubygems