Back to Composio

File Upload/Download Fixes for latest tool with anyOf, oneOf, and allOf Schemas

docs/content/changelog/01-20-26-file-modifier-anyof-support.mdx

0.11.13.5 KB
Original Source

Version Information

TypeScript/JavaScript

  • Package: @composio/core and provider packages
  • Version: 0.5.3+

Python

  • Package: composio and provider packages
  • Version: 0.10.8+

The file handling modifiers now properly handle file_uploadable and file_downloadable properties nested within anyOf, oneOf, and allOf JSON Schema declarations. Previously, only direct child properties (and partial allOf support) were detected for file upload/download transformations.

<Callout type="info"> We recommend updating to version `0.5.3` (TypeScript) or `0.10.8` (Python) or later to ensure file uploads and downloads work correctly with tools that use union or intersection types in their schemas. </Callout>

What Changed

Before (Bug)

File properties inside anyOf, oneOf, or allOf were not detected:

typescript
// @noErrors
// This schema's file_uploadable was NOT being processed
inputParameters: {
  type: 'object',
  properties: {
    fileInput: {
      anyOf: [
        {
          type: 'string',
          file_uploadable: true  // ❌ Not detected
        },
        {
          type: 'null'
        }
      ]
    }
  }
}

After (Fixed)

File properties are now correctly detected and processed at any nesting level:

typescript
// @noErrors
// Now properly detected and transformed
inputParameters: {
  type: 'object',
  properties: {
    fileInput: {
      anyOf: [
        {
          type: 'string',
          file_uploadable: true  // ✅ Detected and processed
        },
        {
          type: 'null'
        }
      ]
    }
  }
}

Affected Scenarios

ScenarioBeforeAfter
file_uploadable in anyOfNot detected✅ Works
file_uploadable in oneOfNot detected✅ Works
file_uploadable in allOfNot detected✅ Works
file_downloadable in anyOfNot detected✅ Works
file_downloadable in oneOfNot detected✅ Works
file_downloadable in allOfNot detected✅ Works
Nested objects inside union typesNot detected✅ Works
Array items with union typesNot detected✅ Works

How to Update

TypeScript/JavaScript

<Tabs items={['npm', 'pnpm', 'yarn']}> <Tab value="npm">

bash
npm update @composio/core@latest
</Tab> <Tab value="pnpm"> ```bash pnpm update @composio/core@latest ``` </Tab> <Tab value="yarn"> ```bash yarn upgrade @composio/core@latest ``` </Tab> </Tabs>

Python

<Tabs items={['pip', 'uv', 'poetry']}> <Tab value="pip">

bash
pip install --upgrade composio
</Tab> <Tab value="uv"> ```bash uv pip install --upgrade composio ``` </Tab> <Tab value="poetry"> ```bash poetry update composio ``` </Tab> </Tabs>

Backward Compatibility

This release is fully backward compatible:

  • All existing code continues to work without modifications
  • No migration required
  • File upload/download for direct properties continues to work as before
  • The fix only adds support for previously unsupported schema patterns

Impact Summary

ChangeRuntime BreakingTypeScript BreakingMigration Required
anyOf support for file uploadsNoNoNo
oneOf support for file uploadsNoNoNo
allOf support for file uploadsNoNoNo
anyOf support for file downloadsNoNoNo
oneOf support for file downloadsNoNoNo
allOf support for file downloadsNoNoNo