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
I'm writing a function with multipart/form-data, with this signature:
[Function("UploadFile")] [OpenApiOperation("UploadFile")] [OpenApiRequestBody(bodyType: typeof(UploadFileRequest), contentType: "multipart/form-data")] [OpenApiResponseWithBody(bodyType: typeof(UploadFileResponse), contentType: "application/json")] public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest httpRequest)
receiving multipart/form data that contains a file and one array of strings.
public class UploadFileRequest { public byte[] File { get; set; } = []; public List<string> Metadata { get; set; } = []; }
swagger.json describes metadata as
metadata
{ "name": "metadata", "description": "", "type": "array", "items": { "type": "string" }, "in": "formData" }
Swagger UI allows to enter strings, e.g.
On the service side, metadata is received as a single value.
For instance, swagger UI suggested curl is:
curl
curl -X POST ... -H ... -F "metadata=a=1,b=2" -F "[email protected];type=image/png"
but the request should be:
curl -X POST ... -H ... -F "metadata=a=1" -F "metadata=b=2" -F "[email protected];type=image/png"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm writing a function with multipart/form-data, with this signature:
receiving multipart/form data that contains a file and one array of strings.
swagger.json describes
metadata
asSwagger UI allows to enter strings, e.g.
Problem
On the service side,
metadata
is received as a single value.For instance, swagger UI suggested
curl
is:but the request should be:
Questions
The text was updated successfully, but these errors were encountered: