Add file upload endpoint to OpenAPI specification #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
API documentation for #20
Add POST /v1/spaces/{space_id}/files endpoint for uploading files via multipart/form-data.
Includes FileUploadResponse schema with file_id (IPFS CID) and object_id fields.
Description
This PR adds OpenAPI documentation for the new file upload endpoint. The endpoint accepts
multipart/form-data file uploads and returns the created file object ID and IPFS CID.
Changes:
POST /v1/spaces/{space_id}/filesendpoint documentationapimodel.FileUploadResponseschema definitionWhat type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
N/A - OpenAPI specification update only.
Example usage:
curl -X POST http://localhost:31009/v1/spaces/{space_id}/files \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Anytype-Version: 2025-05-20" \ -F "file=@/path/to/file.pdf" Example response: { "object_id": "bafyreiabc123def456", "file_id": "bafyreie6n5l5nkbjal37su54cha4coy7qzuhrnajluzv5qd5jvtsrxkequ", "details": { "name": "file.pdf", "sizeInBytes": 12345 } }Added tests?
This is a documentation-only change. Tests are included in the implementation PR.
Added to documentation?
The OpenAPI specification itself serves as the API documentation.