Clinic: maximumLength accepts an empty string #30
closed
@chrismichaelps wrote on 2026-09-28
Observed while smoke-testing 0.1.0 in a scratch project: TextRule.maximumLength(ruleFor(\"name\", ...), 2) run against name = \"\" reports valid.
Reproduction: build the rule above, validate a record with an empty name, check isValid.
Analysis: this is correct behavior, not a defect. An empty string has length 0, which satisfies any non-negative maximum. The clinic expectation was wrong; emptiness is notEmpty/empty territory. Recording here so the expectation is on record. No code change needed.
Read and reply on GitHub ↗1 comment continue on GitHub.
