Skip to content

Commit

Permalink
Revert "refactor!: remove encode_json optional arg for to_dict"
Browse files Browse the repository at this point in the history
This reverts commit 1887d99.
  • Loading branch information
lidatong committed Jul 28, 2020
1 parent da2f981 commit 5aba46a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dataclasses_json/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def to_json(self,
default: Callable = None,
sort_keys: bool = False,
**kw) -> str:
return json.dumps(self.to_dict(),
return json.dumps(self.to_dict(encode_json=False),
cls=_ExtendedEncoder,
skipkeys=skipkeys,
ensure_ascii=ensure_ascii,
Expand Down Expand Up @@ -82,8 +82,8 @@ def from_dict(cls: Type[A],
infer_missing=False) -> A:
return _decode_dataclass(cls, kvs, infer_missing)

def to_dict(self) -> Dict[str, Json]:
return _asdict(self, encode_json=False)
def to_dict(self, encode_json=False) -> Dict[str, Json]:
return _asdict(self, encode_json=encode_json)

@classmethod
def schema(cls: Type[A],
Expand Down

0 comments on commit 5aba46a

Please sign in to comment.