Loading behave_utils/json.py +8 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,10 @@ class JSONObject(JSONPathMixin, dict[str, Any]): """ Create a JSONObject from a JSON string """ return cls(orjson.loads(string)) obj = orjson.loads(string) if not isinstance(obj, dict): raise TypeError(f"expected a JSON mapping, got {type(obj)}") return cls(obj) class JSONArray(JSONPathMixin, list[Any]): Loading @@ -76,4 +79,7 @@ class JSONArray(JSONPathMixin, list[Any]): """ Create a JSONArray from a JSON string """ return cls(orjson.loads(string)) obj = orjson.loads(string) if not isinstance(obj, list): raise TypeError(f"expected a JSON array, got {type(obj)}") return cls(obj) Loading
behave_utils/json.py +8 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,10 @@ class JSONObject(JSONPathMixin, dict[str, Any]): """ Create a JSONObject from a JSON string """ return cls(orjson.loads(string)) obj = orjson.loads(string) if not isinstance(obj, dict): raise TypeError(f"expected a JSON mapping, got {type(obj)}") return cls(obj) class JSONArray(JSONPathMixin, list[Any]): Loading @@ -76,4 +79,7 @@ class JSONArray(JSONPathMixin, list[Any]): """ Create a JSONArray from a JSON string """ return cls(orjson.loads(string)) obj = orjson.loads(string) if not isinstance(obj, list): raise TypeError(f"expected a JSON array, got {type(obj)}") return cls(obj)