docs: def render_json(self):
          'Returns a JSON summary of the validation operation.'
  
          types = {0: 'unknown',
                   1: 'extension',
                   2: 'theme',
                   3: 'dictionary',
                   4: 'langpack',
                   5: 'search',
                   8: 'webapp'}
          output = {'detected_type': types[self.detected_type],
                    'ending_tier': self.ending_tier,
                    'success': not self.failed(),
                    'messages': [],
                    'errors': len(self.errors),
                    'warnings': len(self.warnings),
                    'notices': len(self.notices),
                    'message_tree': self.message_tree,
                    'compatibility_summary': self.compat_summary,
                    'signing_summary': self.signing_summary,
                    'metadata': self.metadata}
  
          messages = output['messages']
  
          # Copy messages to the JSON output
          for error in self.errors:
              error['type'] = 'error'
              messages.append(error)
  
          for warning in self.warnings:
              warning['type'] = 'warning'
              messages.append(warning)
  
          for notice in self.notices:
              notice['type'] = 'notice'
              messages.append(notice)
  
          # Output the JSON.
          return json.dumps(output)