Description
Consider refactoring integer fields with simple constraints (like >0) to use pydantic's conint instead of manual validators for cleaner, more declarative validation.
Context
During review of PR #1234, it was suggested to use conint(gt=0) instead of manual validators for the rate_limit_max field in the WebUi class. This pattern could be applied to other similar fields throughout the codebase.
Examples of fields that could benefit
rate_limit_max in WebUi class (components/clp-py-utils/clp_py_utils/clp_config.py)
retention_period fields with >0 constraints
- Other integer fields with simple positive value constraints
Benefits
- More declarative validation
- Cleaner code by removing manual validators
- Consistent validation approach across the codebase
References
Description
Consider refactoring integer fields with simple constraints (like >0) to use pydantic's
conintinstead of manual validators for cleaner, more declarative validation.Context
During review of PR #1234, it was suggested to use
conint(gt=0)instead of manual validators for therate_limit_maxfield in theWebUiclass. This pattern could be applied to other similar fields throughout the codebase.Examples of fields that could benefit
rate_limit_maxinWebUiclass (components/clp-py-utils/clp_py_utils/clp_config.py)retention_periodfields with >0 constraintsBenefits
References