ads_common/lib/ads_common/parameters_validator.rb
def handle_xsi_type(arg, parent, key, arg_type)
      xsi_type = arg.delete('xsi:type') || arg.delete(:xsi_type)
      if xsi_type
        xsi_field_type = get_full_type_signature(xsi_type)
        if xsi_field_type.nil?
          raise AdsCommon::Errors::ApiException.new(
              "Incorrect xsi:type specified: '%s'" % [xsi_type])
        else
          # TODO: make sure xsi_type is derived from arg_type.
          arg_type = xsi_field_type
          # xsi:type needs to be from a correct namespace.
          if xsi_field_type[:ns]
            xsi_type = prefix_key_with_namespace(xsi_type, xsi_field_type[:ns])
          end
        end
        add_xsi_type(parent, key, xsi_type)
      end
      return arg_type
    end
def handle_xsi_type(arg, parent, key, arg_type)
      xsi_type = arg.delete('xsi:type') || arg.delete(:xsi_type)
      if xsi_type
        xsi_field_type = get_full_type_signature(xsi_type)
        if xsi_field_type.nil?
          raise AdsCommon::Errors::ApiException.new(
              "Incorrect xsi:type specified: '%s'" % [xsi_type])
        else
          # TODO: make sure xsi_type is derived from arg_type.
          arg_type = xsi_field_type
          # xsi:type needs to be from a correct namespace.
          if xsi_field_type[:ns]
            xsi_type = prefix_key_with_namespace(xsi_type, xsi_field_type[:ns])
          end
        end
        add_xsi_type(parent, key, xsi_type)
      end
      return arg_type
    end
Handles custom xsi:type.