summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-11-09 10:36:43 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-12-08 11:52:44 (GMT)
commitdf6a2e6ef46970512c4e0fe873f9fda0fde56261 (patch)
treea4a29f112c015a74ec7cb185ceabfa3adec9395b
parent8d4a718c95cd193cee8af19dd23f313bf9992769 (diff)
downloadbijoe-df6a2e6ef46970512c4e0fe873f9fda0fde56261.zip
bijoe-df6a2e6ef46970512c4e0fe873f9fda0fde56261.tar.gz
bijoe-df6a2e6ef46970512c4e0fe873f9fda0fde56261.tar.bz2
schema: automatically cast scalar value to list values (#28175)
-rw-r--r--bijoe/schemas.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bijoe/schemas.py b/bijoe/schemas.py
index 8bb5bc0..6dd5bb5 100644
--- a/bijoe/schemas.py
+++ b/bijoe/schemas.py
@@ -88,6 +88,8 @@ class Base(object):
kls = types[key]
if isinstance(kls, list):
kls = kls[0]
+ if not isinstance(value, list):
+ value = [value]
if hasattr(kls, 'from_json'):
value = [kls.from_json(v) for v in value]
else: