Skip to content

fix(openapi): convert contentEncoding to format for file uploads#916

Merged
mcollina merged 1 commit intofastify:mainfrom
alexbaileyuk:fix/openapi-file-upload-binary-format
Apr 1, 2026
Merged

fix(openapi): convert contentEncoding to format for file uploads#916
mcollina merged 1 commit intofastify:mainfrom
alexbaileyuk:fix/openapi-file-upload-binary-format

Conversation

@alexbaileyuk
Copy link
Copy Markdown
Contributor

Summary

  • Converts JSON Schema contentEncoding: 'binary' to OpenAPI 3.0 format: 'binary' so Swagger UI shows a file picker for multipart file uploads
  • Also handles contentEncoding: 'base64'format: 'byte'

Closes #800

Test plan

  • Added test for contentEncoding: 'binary'format: 'binary' with multipart/form-data
  • Added test for contentEncoding: 'base64'format: 'byte'
  • All existing tests pass with 100% coverage
  • Generated spec validated by @apidevtools/swagger-parser

🤖 Generated with Claude Code

Closes fastify#800

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexbaileyuk alexbaileyuk marked this pull request as ready for review March 31, 2026 19:54
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit a298dc6 into fastify:main Apr 1, 2026
14 checks passed
@alexbaileyuk alexbaileyuk deleted the fix/openapi-file-upload-binary-format branch April 2, 2026 12:50
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.

Doesn't show file select option on swagger 3.0.0 version

2 participants