Repository: microsoft/botbuilder-python

Issue:
BotFrameworkAdapter.process_activity_with_identity calls serialize() on dict

## Version
4.13.0

## Describe the bug
When running, e.g., the [fetch task](https://github.com/microsoft/botbuilder-python/tree/main/tests/teams/scenarios/action-based-messaging-extension-fetch-task) example, an exception is raised when `on_teams_messaging_extension_fetch_task` is called. The problem is that in `bot_framework_adapter.py` on line 515, `serialize()` is called on `invoke_response.value.body`, which is a python dict.

## To Reproduce
Steps to reproduce the behavior:
1. run the above-mentioned example and add to teams
2. Trigger bot's 'create card' message extension
3. A dialog is shown with an error, and an exception is raised in the bot code.

## Expected behavior
Expected behavior is that the 'Create Card' example dialog is shown instead of an error. A fix to this error could for instance be to change line 515 in `bot_framework_adapter.py` to:
```python
return InvokeResponse(
                status=invoke_response.value.status,
                body=invoke_response.value.body   # line 515
```



Discussion:
@axelsrz Can you take a look at ths?
@jooste thanks for submitting this, we will investigate and provide a fix in our next release if found necessary.
@axelsrz  any updates on this issue?
@jooste thanks for summitting this issue. We'll prioritize fixing this in the next milestone.

Resolving patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py b/libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py
--- a/libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py
+++ b/libraries/botbuilder-core/botbuilder/core/bot_framework_adapter.py
@@ -511,10 +511,7 @@ async def process_activity_with_identity(
             if invoke_response is None:
                 return InvokeResponse(status=int(HTTPStatus.NOT_IMPLEMENTED))
             return InvokeResponse(
-                status=invoke_response.value.status,
-                body=invoke_response.value.body.serialize()
-                if invoke_response.value.body
-                else None,
+                status=invoke_response.value.status, body=invoke_response.value.body,
             )
 
         return None
diff --git a/libraries/botbuilder-integration-aiohttp/setup.py b/libraries/botbuilder-integration-aiohttp/setup.py
--- a/libraries/botbuilder-integration-aiohttp/setup.py
+++ b/libraries/botbuilder-integration-aiohttp/setup.py
@@ -10,7 +10,7 @@
     "botframework-connector==4.14.0",
     "botbuilder-core==4.14.0",
     "yarl<=1.4.2",
-    "aiohttp~=3.6.2",
+    "aiohttp>=3.6.2,<3.8.0",
 ]
 
 root = os.path.abspath(os.path.dirname(__file__))


Test patch:
diff --git a/libraries/botbuilder-ai/tests/requirements.txt b/libraries/botbuilder-ai/tests/requirements.txt
--- a/libraries/botbuilder-ai/tests/requirements.txt
+++ b/libraries/botbuilder-ai/tests/requirements.txt
@@ -1 +1 @@
-aioresponses~=0.6.3
\ No newline at end of file
+aioresponses~=0.7.2
\ No newline at end of file
diff --git a/libraries/botbuilder-core/tests/test_bot_framework_adapter.py b/libraries/botbuilder-core/tests/test_bot_framework_adapter.py
--- a/libraries/botbuilder-core/tests/test_bot_framework_adapter.py
+++ b/libraries/botbuilder-core/tests/test_bot_framework_adapter.py
@@ -815,9 +815,9 @@ async def callback(context: TurnContext):
 
         assert invoke_response
         assert invoke_response.status == 200
-        assert invoke_response.body["id"] == inbound_activity.value.id
+        assert invoke_response.body.id == inbound_activity.value.id
         assert (
-            invoke_response.body["connectionName"]
+            invoke_response.body.connection_name
             == inbound_activity.value.connection_name
         )
 
@@ -880,8 +880,8 @@ async def callback(context):
 
         assert invoke_response
         assert invoke_response.status == 200
-        assert invoke_response.body["id"] == inbound_activity.value.id
+        assert invoke_response.body.id == inbound_activity.value.id
         assert (
-            invoke_response.body["connectionName"]
+            invoke_response.body.connection_name
             == inbound_activity.value.connection_name
         )
diff --git a/libraries/botframework-connector/tests/requirements.txt b/libraries/botframework-connector/tests/requirements.txt
--- a/libraries/botframework-connector/tests/requirements.txt
+++ b/libraries/botframework-connector/tests/requirements.txt
@@ -1,5 +1,5 @@
 pytest-cov>=2.6.0
-pytest==5.2.2
+pytest~=6.2.3
 azure-devtools>=0.4.1
-pytest-asyncio==0.10.0
+pytest-asyncio==0.15.1
 ddt==1.2.1
\ No newline at end of file