We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I got an issue when I want to use the multipart form data content type to send a file.
I am using gin with getkin middleware to validate input requests.
The swagger defintion contains theses values:
post: operationId: saveUploadedFile tags: - Upload responses: '200': description: File successfully uploaded description: Upload a file to the storage bucket. requestBody: content: multipart/form-data: schema: type: object properties: upload: format: binary type: string required: - upload required: true
I have registered the multipart decoder :
openapi3filter.RegisterBodyDecoder("multipart/form-data", openapi3filter.FileBodyDecoder)
But with a curl like:
curl --location --request POST 'http://localhost:8080/uploads' \ --header 'accept: application/json' \ --header 'Content-Type: multipart/form-data' \ --form 'upload=@"/file.jpg"'
I still got the validation openapi3filter.RequestValidationInput with reason doesn't match schema, value must be an object.
openapi3filter.RequestValidationInput
doesn't match schema
value must be an object
But the input request has a object input and gin could find the form file using context.FormFile("upload").
context.FormFile("upload")
Did I missed something about multipart definition?
Thanks :D
The text was updated successfully, but these errors were encountered:
Delete openapi3filter.RegisterBodyDecoder("multipart/form-data", openapi3filter.FileBodyDecoder)
Sorry, something went wrong.
No branches or pull requests
Hi!
I got an issue when I want to use the multipart form data content type to send a file.
I am using gin with getkin middleware to validate input requests.
The swagger defintion contains theses values:
I have registered the multipart decoder :
But with a curl like:
I still got the validation
openapi3filter.RequestValidationInput
with reasondoesn't match schema
,value must be an object
.But the input request has a object input and gin could find the form file using
context.FormFile("upload")
.Did I missed something about multipart definition?
Thanks :D
The text was updated successfully, but these errors were encountered: