<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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