chg: Make clear that to_json returns str

pull/700/head
Raphaël Vinot 2021-02-01 12:17:23 +01:00
parent f6b943cb9a
commit 3494e38987
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta):
to_return = _int_to_str(to_return)
return to_return
def to_json(self, sort_keys: bool = False, indent: Optional[int] = None):
def to_json(self, sort_keys: bool = False, indent: Optional[int] = None) -> str:
"""Dump recursively any class of type MISPAbstract to a json string"""
return dumps(self, default=pymisp_json_default, sort_keys=sort_keys, indent=indent)