def to_json(self, buffer_or_path=None, indent=<NUM_LIT:2>):
<EOL>return json_data_to_json(<EOL>self.to_json_data(),<EOL>buffer_or_path=buffer_or_path,<EOL>indent=indent<EOL>)<EOL>
Parameters
----------
buffer_or_path: buffer or path, default None
    output to write into. If None, will return a json string.
indent: int, default 2
    Defines the indentation of the json

Returns
-------
None, or a json string (if buffer_or_path is None).