Skip to content

Fix EnumPostProcessor#136

Open
wol-soft wants to merge 1 commit into
masterfrom
fix/issue-129-enum-type-check-validator
Open

Fix EnumPostProcessor#136
wol-soft wants to merge 1 commit into
masterfrom
fix/issue-129-enum-type-check-validator

Conversation

@wol-soft
Copy link
Copy Markdown
Owner

Fix EnumPostProcessor stripping type-check validators alongside enum validators

When a property declared both "type": "string" (or "type": "integer") and "enum", the EnumPostProcessor only removed the EnumValidator but left the TypeCheckValidator (is_string/is_int check) in place. Passing a valid enum instance to the setter then incorrectly triggered that type check and threw InvalidTypeException.

Fix: also strip TypeCheckInterface validators when the enum post-processor takes over a property, since the enum filter handles conversion and the UnitEnum guard covers type safety.

Fixes #129

…validators

When a property declared both "type": "string" (or "type": "integer") and
"enum", the EnumPostProcessor only removed the EnumValidator but left the
TypeCheckValidator (is_string/is_int check) in place. Passing a valid enum
instance to the setter then incorrectly triggered that type check and threw
InvalidTypeException.

Fix: also strip TypeCheckInterface validators when the enum post-processor
takes over a property, since the enum filter handles conversion and the
UnitEnum guard covers type safety.

Fixes #129

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 26374991150

Coverage increased (+0.001%) to 98.555%

Details

  • Coverage increased (+0.001%) from the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4843
Covered Lines: 4773
Line Coverage: 98.55%
Coverage Strength: 644.33 hits per line

💛 - Coveralls

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.

Enum valdiation wrong on master

2 participants