Cottonwood-Technology / ValidX

Fast, powerful, and flexible validator with sane syntax.
BSD 2-Clause "Simplified" License
20 stars 4 forks source link

List validator accept dicts #17

Closed GoodWasHere closed 1 year ago

GoodWasHere commented 1 year ago

Version 0.7

>>> import validx
>>> validx.List(validx.Int())({1:1})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "src/validx/cy/containers.pyx", line 108, in validx.cy.containers.List.__call__
validx.exc.errors.InvalidTypeError: <InvalidTypeError(expected=<class 'collections.abc.Sequence'>, actual=<class 'dict'>)>

Version 0.8

>>> import validx
>>> validx.List(validx.Int())({1:1})
[1]