Convert a StackTrace object to json format.

def format_stack_trace_json(self):
        """Convert a StackTrace object to json format."""
        stack_trace_json = {}

        if self.stack_frames:
            stack_trace_json['stack_frames'] = {
                'frame': self.stack_frames,
                'dropped_frames_count': self.dropped_frames_count
            }

        stack_trace_json['stack_trace_hash_id'] = self.stack_trace_hash_id

        return stack_trace_json