Skip to content

Commit 42a94f0

Browse files
Merge pull request #629 from wesleylima/max_occurs-logging
Made maxOccurs validation exception say the correct expected number. …
2 parents 1d1653b + 9a9d72f commit 42a94f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zeep/xsd/elements/element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ def validate(self, value, render_path=None):
221221
# Validate bounds
222222
if len(value) < self.min_occurs:
223223
raise exceptions.ValidationError(
224-
"Expected at least %d items (minOccurs check)" % self.min_occurs,
224+
"Expected at least %d items (minOccurs check) %d items found." % (self.min_occurs, len(value)),
225225
path=render_path)
226226
elif self.max_occurs != 'unbounded' and len(value) > self.max_occurs:
227227
raise exceptions.ValidationError(
228-
"Expected at most %d items (maxOccurs check)" % self.max_occurs,
228+
"Expected at most %d items (maxOccurs check) %d items found." % (self.max_occurs, len(value)),
229229
path=render_path)
230230

231231
for val in value:

0 commit comments

Comments
 (0)