docs: def to_json(self):
          """
          Convert to a json-serializable representation.
  
          Returns:
              dict: A dict representation that is json-serializable.
          """
          return {
              "xblock_id": six.text_type(self.xblock_id),
              "messages": [message.to_json() for message in self.messages],
              "empty": self.empty
          }