Add nested input_filter for field descriptor - #66
Merged
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for nested InputFilter validation, allowing fields to validate nested dictionary structures by specifying an InputFilter class via the input_filter parameter in the field() decorator.
Key Changes:
- Added
input_filterparameter to field descriptors and models to enable nested validation - Implemented nested validation logic in ValidationMixin with type checking and error propagation
- Added comprehensive test coverage for various nested validation scenarios
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/input_filter/test_nested_input_filter.py | New comprehensive test suite for nested InputFilter validation with 20+ test cases |
| pyproject.toml | Version bump from 0.7.4 to 0.7.5 |
| flask_inputfilter/models/field_model/field_model.py | Added input_filter attribute to FieldModel dataclass |
| flask_inputfilter/models/field_model/_field_model.pyx | Added input_filter parameter to Cython FieldModel implementation |
| flask_inputfilter/models/field_model/_field_model.pxd | Added input_filter declaration to Cython header |
| flask_inputfilter/mixins/validation_mixin/validation_mixin.py | Implemented nested validation logic with apply_nested_input_filter method |
| flask_inputfilter/mixins/validation_mixin/_validation_mixin.pyx | Cython implementation of nested validation logic |
| flask_inputfilter/mixins/validation_mixin/_validation_mixin.pxd | Added Cython declaration for nested validation method |
| flask_inputfilter/input_filter.py | Updated to pass input_filter parameter during field registration |
| flask_inputfilter/declarative/field_descriptor.pyi | Added input_filter type hint to field descriptor stub |
| flask_inputfilter/declarative/field_descriptor.py | Added input_filter parameter to FieldDescriptor class |
| flask_inputfilter/declarative/field.py | Added input_filter parameter to field() function with documentation |
| flask_inputfilter/declarative/_field_descriptor.pyx | Added input_filter to Cython FieldDescriptor implementation |
| flask_inputfilter/declarative/_field_descriptor.pxd | Added input_filter declaration to Cython header |
| flask_inputfilter/_input_filter.pyx | Updated Cython InputFilter to pass input_filter parameter |
| docs/source/options/global_decorators.rst | Removed unrelated hierarchical configuration documentation |
| docs/source/options/field_decorator.rst | Added comprehensive documentation for the new input_filter parameter |
| docs/source/changelog.rst | Added changelog entry for version 0.7.5 with nested InputFilter feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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 by Bito
This pull request enhances the Flask input filter library by introducing nested validation capabilities through an 'input_filter' attribute. It includes updates to documentation and a changelog, as well as a comprehensive suite of tests to ensure robust validation across various scenarios.