Skip to content

Commit 544d0ba

Browse files
committed
Fixed multi-part file upload in V2
1 parent be6a700 commit 544d0ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Microsoft.OpenApi/Models/OpenApiOperation.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ public void SerializeAsV2(IOpenApiWriter writer)
228228
{
229229
foreach (var property in RequestBody.Content.First().Value.Schema.Properties)
230230
{
231+
var paramName = property.Key;
232+
var paramSchema = property.Value;
233+
if (paramSchema.Type == "string" && paramSchema.Format == "binary") {
234+
paramSchema.Type = "file";
235+
paramSchema.Format = null;
236+
}
231237
parameters.Add(
232238
new OpenApiFormDataParameter
233239
{

0 commit comments

Comments
 (0)