def convert_type_to_array(datum, options)
      case datum
      when Array
        datum.map { |element| convert_type_to_array(element, options) }
      when Hash
        if datum.key?('type') && datum['type'].is_a?(String) && !options[:type_as_string]
          datum['type'] = [*datum['type']]
        end
        datum.each_with_object({}) do |(k, v), hash|
          if k != 'example'
            hash[k] = convert_type_to_array(v, options)
          else
            hash[k] = v
          end
        end
      else
        datum
      end
    end
def convert_type_to_array(datum, options)
      case datum
      when Array
        datum.map { |element| convert_type_to_array(element, options) }
      when Hash
        if datum.key?('type') && datum['type'].is_a?(String) && !options[:type_as_string]
          datum['type'] = [*datum['type']]
        end
        datum.each_with_object({}) do |(k, v), hash|
          if k != 'example'
            hash[k] = convert_type_to_array(v, options)
          else
            hash[k] = v
          end
        end
      else
        datum
      end
    end
@param [Hash<String, Object>] new_data

 @param [Object] datum
 @return [Object] same type as the input object