Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Fix invalid lookup to required fields in nested json

haxzie4869206d47ab
diff --git a/python/composio/utils/shared.py b/python/composio/utils/shared.py
index c9824c776..332b2e67f 100644
--- a/python/composio/utils/shared.py
+++ b/python/composio/utils/shared.py
@@ -133,13 +133,7 @@ def json_schema_to_pydantic_field(
if not skip_default:
field["default"] = (
...
- if (
- name in required
- or json_schema.get(
- "required",
- False,
- )
- )
+ if name in required
else default
)
@@ -263,7 +257,7 @@ def pydantic_model_from_param_schema(param_schema: t.Dict) -> t.Type:
else:
field_kwargs["title"] = prop_title
- if prop_name in required_props or prop_info.get("required", False):
+ if prop_name in required_props:
required_fields[prop_name] = (
signature_prop_type,
Field(..., **field_kwargs),