feat: Implement General Dataset API with CRUD Operations#91
Merged
Conversation
- Add ResourceRequest model for flexible resource definitions - Add GeneralDatasetRequest for dataset creation - Add GeneralDatasetUpdateRequest for partial updates - Include comprehensive field validation and documentation
- Add ResourceResponse model for resource data in responses - Add GeneralDatasetResponse for complete dataset information - Include timestamps and metadata fields for comprehensive responses
- Add create_general_dataset for flexible dataset creation - Add update_general_dataset for full dataset replacement - Add patch_general_dataset for partial updates - Include comprehensive validation and error handling
- Add general dataset creation endpoint with flexible schema - Support local and pre_ckan server selection - Include comprehensive validation and error handling - Add detailed API documentation with examples
- Add general dataset update endpoint for full replacement - Support local and pre_ckan server selection - Include comprehensive error handling for 404 and validation errors - Add detailed API documentation with usage examples
- Add general dataset partial update endpoint - Support merging of extras with existing metadata - Include comprehensive error handling and validation - Add detailed documentation explaining partial update behavior
- Ensure register_router includes general dataset creation - Ensure update_router includes general dataset updates - Verify endpoints are properly exposed in API
- Add groups field to request and response models
- Update service functions to handle groups parameter
- Modify all three endpoints (POST, PUT, PATCH) to support groups
- Groups are formatted as CKAN expects: [{"name": "group_name"}]
- Add full test coverage for create_general_dataset function - Add tests for update_general_dataset with field merging - Add tests for patch_general_dataset delegation - Test parameter validation, error handling, and CKAN instance selection - Cover extras validation, reserved keys, and resource creation - Restore 70%+ test coverage after new files addition
- Add comprehensive tests for general_dataset service (74 lines, 8% → ~95%) - Add tests for post_general_dataset route (36 lines, 28% → ~85%) - Cover create/update/patch dataset operations with full validation - Test error handling for duplicate datasets, server config, and validation - Test pre_ckan vs local server selection and field validation - Restore 70%+ coverage after new general dataset files addition - Total improvement: 69% → 70%+ test coverage
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.
📋 Description
This PR introduces a comprehensive General Dataset API with full CRUD operations, including support for groups, comprehensive testing, and documentation.
🚀 Features Added
API Endpoints
Core Components
Quality Assurance
🔧 Technical Details
Files Modified/Added
Testing
📚 Documentation
🔍 Code Quality
📊 Metrics
📝 Checklist