Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance fileupload UI for multipart/form-data #667

Open
2 tasks done
imjuni opened this issue Sep 13, 2022 · 1 comment
Open
2 tasks done

Enhance fileupload UI for multipart/form-data #667

imjuni opened this issue Sep 13, 2022 · 1 comment
Labels
semver-minor Issue or PR that should land as semver minor

Comments

@imjuni
Copy link
Contributor

imjuni commented Sep 13, 2022

Prerequisites

  • I have written a descriptive issue title
  • 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,

filewidget

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.

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.

  1. Checkout feature/fileupload
  2. Install package: npm install
  3. Run development server: npm run dev
  4. open url on browser: http://localhost:17878

Finally you can see like that:
swagger_fileupload_widget02

@mcollina
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Issue or PR that should land as semver minor
Projects
None yet
Development

No branches or pull requests

2 participants