Remove asset_url from document chunk API responses - #46
Merged
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the
asset_urlfield from document chunk API responses. The chunk list and single-chunk endpoints previously included anasset_urlproperty (either a generated URL ornull) alongside aninclude_asset_urlsquery 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_urlhelper method,_MEDIA_CHUNK_TYPESconstant,include_asset_urlsparameter from service methods, and theasset_urlfield from_chunk_payloadapps/api/app/api/v1/routes/documents.py— Removedinclude_asset_urlsquery parameter fromGET /documents/{id}/chunksandGET /documents/{id}/chunks/{chunk_id}apps/api/tests/contract/test_documents_contract.py— Removedasset_urlfield from chunk response assertionsTest results