Closed nightspite closed 2 months ago
Latest commit: 3436269f8d2ee34687009a58a2f87c498393c183
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@nightspite is attempting to deploy a commit to the ts-rest Team on Vercel.
A member of the Team first needs to authorize it.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication
Unfortunately, this would break the typing for both the client and server, and also fail validation on the server. Maybe this works for you in a specific use-case, but we cannot include this in the official docs.
How will that fail a validation on the server? Current version in the docs specifies type only, no validation there.
contentType: 'multipart/form-data', // <- Only difference
body: c.type<{ thumbnail: File }>(), // <- Use File type in here
And as far as I remember the multipart content type is not respected in openapi schema.
I have lost some time looking for a way to extend the schema to handle file upload properly - correct openapi representation was worth more for me than the typed input. In swagger this field is displayed as a file input
https://swagger.io/docs/specification/describing-request-body/file-upload/