Add get/update document endpoints and supporting models#77
Merged
Conversation
- Updated the delete document functionality to specify deletion from PostgreSQL and OpenSearch. - Introduced new `get_document` and `update_document` endpoints for retrieving and updating document details, respectively. - Enhanced the `list_documents` endpoint to clarify that it lists documents from PostgreSQL. - Added new models: `DocumentDetailResponse` and `DocumentUpdateRequest` for handling document details and update requests. - Updated existing models to include new fields for better data representation. These changes improve the document management capabilities and provide a more comprehensive API for users.
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
Enhances the document management API client with full CRUD capabilities by adding new endpoints for retrieving and updating individual documents, along with corresponding request/response models and high-level client methods.
Key Accomplishments
New API Endpoints
get_document– Retrieve a single document's details by ID, returning the newDocumentDetailResponsemodelupdate_document– Update document metadata/properties via aDocumentUpdateRequestpayloadNew Models
DocumentDetailResponse– Rich response model for individual document retrieval, providing more comprehensive document information than the list-level representationDocumentUpdateRequest– Request model encapsulating fields that can be modified on an existing documentUpdated Existing Components
document_client.py– Extended the high-levelDocumentClientwith convenience methods for get and update operations, completing the CRUD surfaceDocumentListItem– Expanded with additional fields/attributes to align with backend API changesDocumentUploadResponse– Minor additions to capture extra response datadelete_document,list_documents,upload_document,upload_documents_bulk) – Minor adjustments for consistency across the API layermodels/__init__.py– Exported new models for public consumptionBreaking Changes
DocumentListItemmodel changes – Fields have been added and potentially restructured. Consumers that rely on strict field enumeration or serialization of this model should verify compatibility.Testing Notes
DocumentDetailResponsecorrectly deserializes all fields returned by the get endpointDocumentUpdateRequestproperly serializes partial updates (ensure optional/unset fields are omitted rather than sent as null, if applicable)DocumentListItemmodel remains backward-compatible with existing list responsesInfrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/document-platform-crudmainCo-Authored-By: Claude noreply@anthropic.com