chore: use only binary file for CreateFile api#30
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the sandbox “Create file” API contract and SDK facades to send raw binary file content in the request body instead of a JSON { content: ... } payload.
Changes:
- TypeScript
Sandbox.files.createnow acceptsstring | Blob | Fileand forwards a binary body tocreateFile. - Python
FilesFacade.create_filenow acceptsbytes | str, converts to a binary payload, and callscreate_filewith aFileupload type. - OpenAPI
createFilerequestBody changed toapplication/octet-streamwithformat: binary, plus additional OpenAPI formatting/structure changes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| together-sandbox-typescript/src/TogetherSandbox.ts | Switches file creation to send binary bodies (Blob/File), with string-to-Blob conversion. |
| together-sandbox-python/together_sandbox/facade.py | Switches file creation to send binary bodies by wrapping bytes in an upload File. |
| sandbox-openapi.json | Updates createFile requestBody to raw binary octet-stream; includes additional spec changes (e.g., uid/gid fields, schema reshaping). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "FileCreateRequest": { | ||
| "type": "object", | ||
| "properties": { | ||
| "content": { | ||
| "type": "string", | ||
| "description": "File content to create" | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
FileCreateRequest is reintroduced under components/schemas but the createFile operation no longer references it (it now uses a raw application/octet-stream binary schema). Since this schema is unused, it will still be generated into SDKs and can confuse consumers about the supported request shape. Consider removing FileCreateRequest entirely, or (if it’s still intended) update createFile.requestBody to reference it and keep the request content-type as JSON.
| "FileCreateRequest": { | |
| "type": "object", | |
| "properties": { | |
| "content": { | |
| "type": "string", | |
| "description": "File content to create" | |
| } | |
| } | |
| }, |
No description provided.