Skip to content

Reject empty files and name the purpose param - #856

Merged
SaladDay merged 3 commits into
mainfrom
fix/files-create-errors
Oct 25, 2026
Merged

SaladDay merged 3 commits into
mainfrom
fix/files-create-errors

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Official API alignment (FS-17, FS-18).

  • POST /v1/files with an empty file returns 400 File is empty. (null code and param) and stores nothing.
  • A missing purpose part returns Missing required parameter: 'purpose'. and any other value Only purpose user_data is supported., both with param: "purpose" and the Files routes' null code.
  • Docs (source-files.md + zh) and the Web Files copy updated.

Checks: go test ./internal/files ./internal/api -run 'SourceFile|Files|TestCreate', go vet ./..., gofmt.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@blacksmith-sh

This comment has been minimized.

@SaladDay
SaladDay merged commit c999175 into main Oct 25, 2026
22 checks passed
@SaladDay
SaladDay deleted the fix/files-create-errors branch October 25, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant