Skip to content

fix(python): handle missing JSON schema titles in json_schema_to_model#2705

Open
liuxiaopai-ai wants to merge 2 commits intoComposioHQ:nextfrom
liuxiaopai-ai:fix/json-schema-to-model-missing-title
Open

fix(python): handle missing JSON schema titles in json_schema_to_model#2705
liuxiaopai-ai wants to merge 2 commits intoComposioHQ:nextfrom
liuxiaopai-ai:fix/json-schema-to-model-missing-title

Conversation

@liuxiaopai-ai
Copy link

@liuxiaopai-ai liuxiaopai-ai commented Feb 20, 2026

Fixes #2435

Problem

The Python helper json_schema_to_model could pass a null/None model name into pydantic.create_model when the JSON schema omitted title (common for anonymous nested object schemas, e.g. array items). This raises:

TypeError: type.__new__() argument 1 must be str, not None

Fix

  • Fall back to name and finally a generated model name when title is missing
  • Add a regression test for an object schema containing an array of anonymous objects

Validation

  • pytest -q python/tests/test_json_schema_to_model_missing_title.py
  • ruff check python/composio/utils/shared.py python/tests/test_json_schema_to_model_missing_title.py

Fixes ComposioHQ#2435

- Provide a fallback model name when schema omits title/name
- Add regression test for anonymous nested object schemas
@vercel
Copy link

vercel bot commented Feb 20, 2026

Someone is attempting to deploy a commit to the Composio Team on Vercel.

A member of the Team first needs to authorize it.

@liuxiaopai-ai
Copy link
Author

FYI: the failing 'Vercel' check appears to be an integration/auth issue on the repo side ('Authorization required to deploy'), not related to this Python-only change. If needed, a maintainer may need to authorize Vercel for this PR/run or mark it non-blocking.

@haxzie haxzie requested a review from jkomyno February 20, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError: type.__new__() argument 1 must be str, not None in json_schema_to_model (LangGraph Provider)

2 participants