code: def test_parse_valid_json_message(self):
      connector = OpenAPIServiceConnector()
  
      # The content format here is OpenAI function calling descriptor
      content = (
          '[{"function":{"name": "compare_branches","arguments": "{\\n  \\"parameters\\": {\\n   '
          ' \\"basehead\\": \\"main...openapi_container_v5\\",\\n   '
          ' \\"owner\\": \\"deepset-ai\\",\\n    \\"repo\\": \\"haystack\\"\\n  }\\n}"}, "type": "function"}]'
      )
      descriptors = connector._parse_message(
          ChatMessage.from_assistant(content)
      )
  
      # Assert that the descriptor contains the expected method name and arguments
      assert descriptors[0]["name"] == "compare_branches"
      assert descriptors[0]["arguments"]["parameters"] == {
          "basehead": "main...openapi_container_v5",
          "owner": "deepset-ai",
          "repo": "haystack",
      }
      # but not the requestBody
      assert "requestBody" not in descriptors[0]["arguments"]
  
      # The content format here is OpenAI function calling descriptor
      content = '[{"function": {"name": "search","arguments": "{\\n  \\"requestBody\\": {\\n    \\"q\\": \\"haystack\\"\\n  }\\n}"}, "type": "function"}]'
      descriptors = connector._parse_message(
          ChatMessage.from_assistant(content)
      )
      assert descriptors[0]["name"] == "search"
      assert descriptors[0]["arguments"]["requestBody"] == {
          "q": "haystack"
      }
  
      # but not the parameters
      assert "parameters" not in descriptors[0]["arguments"]
  
file_path: haystack/test/components/connectors/test_openapi_service.py
imports: import json
  import pytest
  from unittest.mock import MagicMock, Mock
  from openapi3 import OpenAPI
  from haystack.components.connectors import OpenAPIServiceConnector
  from haystack.dataclasses import ChatMessage
label_desc: Use image node_id 3 for calling the TestOpenAPIServiceConnector obj's underlying member method code with example usage: obj.test_parse_valid_json_message() without return types