Skip to content

Add input type validation to deep_mapping validator to prevent crashe…#1562

Open
uwezkhan wants to merge 2 commits into
python-attrs:mainfrom
uwezkhan:fix/deep-mapping-validation-
Open

Add input type validation to deep_mapping validator to prevent crashe…#1562
uwezkhan wants to merge 2 commits into
python-attrs:mainfrom
uwezkhan:fix/deep-mapping-validation-

Conversation

@uwezkhan
Copy link
Copy Markdown

The deep_mapping validator didn't validate that input was actually a mapping before processing it. This fix adds explicit type checking using isinstance(value, Mapping) to prevent crashes and malformed data processing. Changes: validators.py: Added import and validation check in _DeepMapping.call() test_validators.py: Added test_fail_non_mapping() test case

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