diff --git a/jumpscale/core/base/fields.py b/jumpscale/core/base/fields.py index cec8baead..265f8ef44 100644 --- a/jumpscale/core/base/fields.py +++ b/jumpscale/core/base/fields.py @@ -1041,7 +1041,7 @@ def to_raw(self, value): class Json(String): - def __init__(self, default="{}", encoding="utf-8", **kwargs): + def __init__(self, default="{}", **kwargs): """ Json field, will check if the value is a valid json string. @@ -1049,10 +1049,8 @@ def __init__(self, default="{}", encoding="utf-8", **kwargs): Args: default (str, optional): default value. Defaults to "{}" - encoding: encoding to be used when serializing the value. Defaults to "utf-8" kwargs: other keyword arguments supported by `String` """ - self.encoding = encoding super().__init__(default=default, **kwargs) def validate(self, value): @@ -1072,7 +1070,7 @@ def validate(self, value): # if it's a string, try to load it try: - json.loads(value, encoding=self.encoding) + json.loads(value) except Exception as e: raise ValidationError(f"'{value}' isn't a valid json, {e}") from e