Skip to content

Remove asset_url from document chunk API responses - #46

Merged
suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/remove-chunk-asset-urls
May 13, 2026
Merged

suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/remove-chunk-asset-urls

Conversation

@suguanYang

@suguanYang suguanYang commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the asset_url field from document chunk API responses. The chunk list and single-chunk endpoints previously included an asset_url property (either a generated URL or null) alongside an include_asset_urls query parameter that controlled URL generation. This field does not belong in the chunk API, so the associated logic is removed.

Changes

  • apps/api/app/services/document_service.py — Removed _asset_url helper method, _MEDIA_CHUNK_TYPES constant, include_asset_urls parameter from service methods, and the asset_url field from _chunk_payload
  • apps/api/app/api/v1/routes/documents.py — Removed include_asset_urls query parameter from GET /documents/{id}/chunks and GET /documents/{id}/chunks/{chunk_id}
  • apps/api/tests/contract/test_documents_contract.py — Removed asset_url field from chunk response assertions

Test results

apps/api/tests/contract/test_documents_contract.py: 9 passed in 15.93s

The chunk list and single-chunk endpoints included an `asset_url` field
(either a generated URL or null) and an `include_asset_urls` query
parameter to gate URL generation. Remove this logic entirely: the chunk
API should not return asset URLs. This removes:

- `_asset_url` method and `_MEDIA_CHUNK_TYPES` constant
- `include_asset_urls` parameter from list_document_chunks and
  get_document_chunk service methods
- `include_asset_urls` query parameter from both chunk endpoints
- `asset_url` field from `_chunk_payload` responses
- `get_result_storage` import no longer needed

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@suguanYang
suguanYang merged commit e1a840b into main May 13, 2026
9 checks passed
suguanYang added a commit that referenced this pull request May 13, 2026
asset_url was removed from the regular document chunk API responses
in PR #46. The contract test now uses file_path instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant