Enhance fileupload UI for multipart/form-data
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
As a first, Great thank you for good tools. I suggest to enhance swagger ui for fileupload. Recently OpenAPI 3.0 support filpupload widget below,

from: https://swagger.io/docs/specification/describing-request-body/file-upload/
But I cannot found documentation that display fileupload widget on @fastify/multipart and @fastify/swagger.
So I test 4 way of usage.
- case01 display fileupload widget but cannot pass validation
- case02 display plaing object ui
- from: @fastify/multipart
- case03 display string ui
- case04 working
Expectation
I think that display fileupload widget and validate using by sharedSchemaId in @fastify/multipart. Or I want to know best practice for file upload and swagger.
Environment
| Package | Version |
|---|---|
| @fastify/multipart | ^7.1.2 |
| @fastify/swagger | ^7.5.1 |
| fastify | ^4.5.3 |
| fastify-plugin | ^4.2.1 |
| ajv | ^8.11.0 |
| ajv-formats | ^2.1.1 |
| node | 16.17.0 |
| npm | 8.15.0 |
| os | win32, macOSX |
Motivation
Better develop experience provide to co-worker or consumer.
Example
I upload sample project my repo.
- Checkout
feature/fileupload - Install package:
npm install - Run development server:
npm run dev - open url on browser:
http://localhost:17878
Finally you can see like that:

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.