Skip to content

Add Support for File Upload with octetInputParser#78

Open
levirs565 wants to merge 1 commit into
aidansunbury:mainfrom
levirs565:add-file-input
Open

Add Support for File Upload with octetInputParser#78
levirs565 wants to merge 1 commit into
aidansunbury:mainfrom
levirs565:add-file-input

Conversation

@levirs565

Copy link
Copy Markdown

tRPC 11 support natively support uploading FIle (https://trpc.io/docs/server/non-json-content-types) using octetInputParser . However when using this method, mutation can only upload 1 file and cannot add other key. Also, actually octetInputParser is not valid Zod schema. When we call zodToJsonSchema to mutation input with octetInputParse, this will cause error. Fotunately, octetInputParser is constant, when input definition is equal to octetInputParser, we can assume the mutation accept a file as input. Currently, client validation not work on file input.

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