Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 18:30 UTC
test: add unit tests for the schema_converter boolean-schema filter (#3876)
## Description `composio.utils.schema_converter._filter_boolean_schemas` pre-processes JSON Schemas before handing them to `json-schema-to-pydantic`, which doesn't support boolean schemas (draft-06+ allows `true`/`false` as schemas). It replaces `true` with `{}`, drops `false`, and recurses through combiner arrays (`anyOf`/`allOf`/`oneOf`), `properties`, `items` and `$defs`. It had no test coverage. This adds `python/tests/test_schema_converter.py` covering: - `True` -> `{}` and `False` -> `None` - non-schema values passing through unchanged - lists dropping `False` entries, and an all-`False` list becoming `None` - combiner arrays dropping `False` entries, and the whole combiner being removed when every entry is `False` - a `False` property being dropped while siblings are kept - plain keys being preserved No source changes. ## Verification `pytest python/tests/test_schema_converter.py` - 9 passed. `ruff check` / `ruff format` clean. Co-authored-by: jkomyno <alberto@composio.dev>