googleapis / googleapis/java-genai

displayName (and other config fields) not included in uploadToFileSearchStore request

Open
#821 1 comment 0 reactions 1 assignee Claimed by @hemasekhar-p View on GitHub
priority: p2 type: bug
Dominant language
Java
Stars
397
Forks
125
Avg merge
2d 8h
Merged PRs (30d)
41

Description

#### Environment details

- Programming language: Java
- OS: macOS
- Language runtime version: Java 11+
- Package version: 1.38.0

#### Steps to reproduce

1. Create an `UploadToFileSearchStoreConfig` with `displayName` set:

```java
UploadToFileSearchStoreConfig config = UploadToFileSearchStoreConfig.builder()
.displayName("my-document")
.build();

client.fileSearchStores.uploadToFileSearchStore(storeName, file, config);
```

2. The displayName is silently dropped from the actual API request.

Root Cause

In `FileSearchStores.java`, the `getUploadUrl()` method (line 910-915) creates a new `UploadToFileSearchStoreConfig` with only `httpOptions` and `shouldReturnHttpResponse`, discarding the original `config`'s fields:

```
UploadToFileSearchStoreResumableResponse response =
privateUploadToFileSearchStore(
fileSearchStoreName,
UploadToFileSearchStoreConfig.builder()
.httpOptions(httpOptions)
.shouldReturnHttpResponse(true)
.build());
```

This also affects customMetadata and chunkingConfig.

Expected Behavior

The original config fields (displayName, customMetadata, chunkingConfig) should be preserved and included in the request to the API.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.