Skip to content

Commit

Permalink
Fix Grokzen#194: Fix error message related to string length limits
Browse files Browse the repository at this point in the history
  • Loading branch information
sdruskat committed Sep 1, 2022
1 parent 4fb3b7b commit 6ced6f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pykwalify/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def _validate_length(self, rule, value, path, prefix):

if min_ is not None and min_ > value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than min limit '{min_}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', less than min limit '{min_}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand All @@ -898,7 +898,7 @@ def _validate_length(self, rule, value, path, prefix):

if max_ex is not None and max_ex <= value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than max_ex limit '{max_ex}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', greater than or equal to max_ex limit '{max_ex}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand All @@ -907,7 +907,7 @@ def _validate_length(self, rule, value, path, prefix):

if min_ex is not None and min_ex >= value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than min_ex limit '{min_ex}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', less than or equal to min_ex limit '{min_ex}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand Down

0 comments on commit 6ced6f9

Please sign in to comment.