summaryrefslogtreecommitdiff
path: root/wsme/rest
diff options
context:
space:
mode:
Diffstat (limited to 'wsme/rest')
-rw-r--r--wsme/rest/json.py2
-rw-r--r--wsme/rest/xml.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/wsme/rest/json.py b/wsme/rest/json.py
index 180ee2c..77277ce 100644
--- a/wsme/rest/json.py
+++ b/wsme/rest/json.py
@@ -140,7 +140,7 @@ def fromjson(datatype, value):
elif attrdef.mandatory:
raise InvalidInput(attrdef.name, None,
"Mandatory field missing.")
- return obj
+ return wsme.types.validate_value(datatype, obj)
elif wsme.types.isusertype(datatype):
value = datatype.frombasetype(
fromjson(datatype.basetype, value))
diff --git a/wsme/rest/xml.py b/wsme/rest/xml.py
index 1ebc3d5..9a836c3 100644
--- a/wsme/rest/xml.py
+++ b/wsme/rest/xml.py
@@ -105,7 +105,7 @@ def fromxml(datatype, element):
elif attrdef.mandatory:
raise InvalidInput(attrdef.name, None,
"Mandatory field missing.")
- return obj
+ return wsme.types.validate_value(datatype, obj)
if datatype is wsme.types.bytes:
return element.text.encode('ascii')
return datatype(element.text)