| 
25 | 25 | from st2common.exceptions.action import InvalidActionParameterException  | 
26 | 26 | from st2common.util import jsonify  | 
27 | 27 | from st2common.util.misc import deep_update  | 
28 |  | -from st2common.util.ujson import fast_deepcopy  | 
 | 28 | +from st2common.util.deep_copy import fast_deepcopy_dict  | 
29 | 29 | 
 
  | 
30 | 30 | __all__ = [  | 
31 | 31 |     "get_validator",  | 
 | 
80 | 80 | 
 
  | 
81 | 81 | 
 
  | 
82 | 82 | def get_draft_schema(version="custom", additional_properties=False):  | 
83 |  | -    schema = fast_deepcopy(SCHEMAS[version])  | 
 | 83 | +    schema = fast_deepcopy_dict(SCHEMAS[version])  | 
84 | 84 |     if additional_properties and "additionalProperties" in schema:  | 
85 | 85 |         del schema["additionalProperties"]  | 
86 | 86 |     return schema  | 
@@ -199,7 +199,7 @@ def assign_default_values(instance, schema):  | 
199 | 199 |     """  | 
200 | 200 |     Assign default values on the provided instance based on the schema default specification.  | 
201 | 201 |     """  | 
202 |  | -    instance = fast_deepcopy(instance)  | 
 | 202 | +    instance = fast_deepcopy_dict(instance)  | 
203 | 203 |     instance_is_dict = isinstance(instance, dict)  | 
204 | 204 |     instance_is_array = isinstance(instance, list)  | 
205 | 205 | 
 
  | 
@@ -262,7 +262,7 @@ def modify_schema_allow_default_none(schema):  | 
262 | 262 |     Manipulate the provided schema so None is also an allowed value for each attribute which  | 
263 | 263 |     defines a default value of None.  | 
264 | 264 |     """  | 
265 |  | -    schema = fast_deepcopy(schema)  | 
 | 265 | +    schema = fast_deepcopy_dict(schema)  | 
266 | 266 |     properties = schema.get("properties", {})  | 
267 | 267 | 
 
  | 
268 | 268 |     for property_name, property_data in six.iteritems(properties):  | 
@@ -336,7 +336,7 @@ def validate(  | 
336 | 336 |     :param use_default: True to support the use of the optional "default" property.  | 
337 | 337 |     :type use_default: ``bool``  | 
338 | 338 |     """  | 
339 |  | -    instance = fast_deepcopy(instance)  | 
 | 339 | +    instance = fast_deepcopy_dict(instance)  | 
340 | 340 |     schema_type = schema.get("type", None)  | 
341 | 341 |     instance_is_dict = isinstance(instance, dict)  | 
342 | 342 | 
 
  | 
 | 
0 commit comments