def check_children(child_schema, value)
      return unless child_schema && value.present?

      if value.is_a? Array
        value.map(&:errors).reject(&:empty?)
      else
        value.errors
      end
    end
def check_children(child_schema, value)
      return unless child_schema && value.present?

      if value.is_a? Array
        value.map(&:errors).reject(&:empty?)
      else
        value.errors
      end
    end
Given a schema and a value which may be a single record or collection,
 collect and return any errors.
 @param [SchemaModel] child_schema - A schema object class
 @param [Object] value - Array of models or single model
 @return [Object] Array of errors hashes, or one hash.
                   Structure matches 'value' input