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

next
mdx 150 lines 3.68 KB
Raw
1 ---
2 title: "File Upload/Download Fixes for latest tool with anyOf, oneOf, and allOf Schemas"
3 description: "File handling modifiers now properly handle nested anyOf, oneOf, and allOf JSON Schema declarations"
4 date: "2026-01-20"
5 ---
6
7 ## Version Information
8
9 ### TypeScript/JavaScript
10 - Package: `@composio/core` and provider packages
11 - Version: `0.5.3`+
12
13 ### Python
14 - Package: `composio` and provider packages
15 - Version: `0.10.8`+
16
17 ---
18
19 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.
20
21 <Callout type="info">
22 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.
23 </Callout>
24
25 ## What Changed
26
27 ### Before (Bug)
28
29 File properties inside `anyOf`, `oneOf`, or `allOf` were not detected:
30
31 ```typescript
32 // @noErrors
33 // This schema's file_uploadable was NOT being processed
34 inputParameters: {
35 type: 'object',
36 properties: {
37 fileInput: {
38 anyOf: [
39 {
40 type: 'string',
41 file_uploadable: true // ❌ Not detected
42 },
43 {
44 type: 'null'
45 }
46 ]
47 }
48 }
49 }
50 ```
51
52 ### After (Fixed)
53
54 File properties are now correctly detected and processed at any nesting level:
55
56 ```typescript
57 // @noErrors
58 // Now properly detected and transformed
59 inputParameters: {
60 type: 'object',
61 properties: {
62 fileInput: {
63 anyOf: [
64 {
65 type: 'string',
66 file_uploadable: true // ✅ Detected and processed
67 },
68 {
69 type: 'null'
70 }
71 ]
72 }
73 }
74 }
75 ```
76
77 ## Affected Scenarios
78
79 | Scenario | Before | After |
80 |----------|--------|-------|
81 | `file_uploadable` in `anyOf` | Not detected | ✅ Works |
82 | `file_uploadable` in `oneOf` | Not detected | ✅ Works |
83 | `file_uploadable` in `allOf` | Not detected | ✅ Works |
84 | `file_downloadable` in `anyOf` | Not detected | ✅ Works |
85 | `file_downloadable` in `oneOf` | Not detected | ✅ Works |
86 | `file_downloadable` in `allOf` | Not detected | ✅ Works |
87 | Nested objects inside union types | Not detected | ✅ Works |
88 | Array items with union types | Not detected | ✅ Works |
89
90 ## How to Update
91
92 ### TypeScript/JavaScript
93
94 <Tabs items={['npm', 'pnpm', 'yarn']}>
95 <Tab value="npm">
96 ```bash
97 npm update @composio/core@latest
98 ```
99 </Tab>
100 <Tab value="pnpm">
101 ```bash
102 pnpm update @composio/core@latest
103 ```
104 </Tab>
105 <Tab value="yarn">
106 ```bash
107 yarn upgrade @composio/core@latest
108 ```
109 </Tab>
110 </Tabs>
111
112 ### Python
113
114 <Tabs items={['pip', 'uv', 'poetry']}>
115 <Tab value="pip">
116 ```bash
117 pip install --upgrade composio
118 ```
119 </Tab>
120 <Tab value="uv">
121 ```bash
122 uv pip install --upgrade composio
123 ```
124 </Tab>
125 <Tab value="poetry">
126 ```bash
127 poetry update composio
128 ```
129 </Tab>
130 </Tabs>
131
132 ## Backward Compatibility
133
134 This release is fully backward compatible:
135
136 - All existing code continues to work without modifications
137 - No migration required
138 - File upload/download for direct properties continues to work as before
139 - The fix only adds support for previously unsupported schema patterns
140
141 ## Impact Summary
142
143 | Change | Runtime Breaking | TypeScript Breaking | Migration Required |
144 |--------|------------------|---------------------|-------------------|
145 | `anyOf` support for file uploads | No | No | No |
146 | `oneOf` support for file uploads | No | No | No |
147 | `allOf` support for file uploads | No | No | No |
148 | `anyOf` support for file downloads | No | No | No |
149 | `oneOf` support for file downloads | No | No | No |
150 | `allOf` support for file downloads | No | No | No |