knowhere icon indicating copy to clipboard operation
knowhere copied to clipboard

SUPPORTED_EXTENSIONS default omits parseable .json

Open Frankie-Xu opened this issue 2 months ago • 2 comments

Problem

Worker format_router.SUPPORTED_FILE_TYPES and README list .json as supported (JsonParseAdapter exists). The API admission default in packages/shared-python/shared/core/config/storage.py does not:

SUPPORTED_EXTENSIONS: str = Field(
    default=".doc,.docx,.pdf,.txt,.xls,.xlsx,.pptx,.jpg,.jpeg,.png,.md,.html,.htm",
)

A self-hosted install that does not override SUPPORTED_EXTENSIONS therefore rejects .json at the API even though the worker can parse it.

.html / .htm are already in both the worker router and the storage default. .json is the odd one out.

Why this is not a drive-by patch

Changing the storage default is a public admission-behavior change. apps/api/.env.example / apps/worker/.env.example currently also omit .json (after dropping the unsupported .csv advertisement in a separate PR). Adding .json to the default should be an explicit maintainer decision, not bundled with example cleanup.

Suggested options

  1. Add .json to the SUPPORTED_EXTENSIONS default and both .env.example files so out-of-the-box matches worker/README.
  2. Keep the default as-is and document .json as opt-in via SUPPORTED_EXTENSIONS.

I am not implementing either here. Asking which contract you want.

Frankie-Xu avatar Sep 14 '26 18:09 Frankie-Xu

Related example-only cleanup (does not change this default): https://github.com/Ontos-AI/knowhere/pull/417

Frankie-Xu avatar Sep 14 '26 18:09 Frankie-Xu

Supplemental observation: .json upload support on main

Snapshot checked: 3352f32

Verified observations

  1. The README lists .json as supported, but the default API upload allowlist omits it. The worker’s document format router also has no .json route.
  2. The earlier snapshot 9489fa2 did have the JsonParseAdapter mentioned in the original report. Its parse() method returned parsed_df=None without reading the input file. Commit 551956b removed both the route and the adapter on November 17. Scope: This was a static code check, not an end-to-end upload test. On the checked revision, adding .json to SUPPORTED_EXTENSIONS alone would not enable parsing through the standard worker route.

lostlight530 avatar Nov 20 '26 08:11 lostlight530