Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

multipart/form-data in V2 is not properly handled #747

Copy link
Copy link
@justinyoo

Description

@justinyoo
Issue body actions

Hi, Team.

I found that there had been an issue #509 and fix #511 with regards to the file upload through the multipart/form-data content type. However, when I checked the source code, it only partially covers the cases.

  1. According to the OpenAPI v3.0.1 spec, file input/output can be the schema type/format of string/binary or string/base64. However, the codebase only looks after the string/binary pair.

    if (paramSchema.Type == "string" && paramSchema.Format == "binary") {
    paramSchema.Type = "file";
    paramSchema.Format = null;
    }

  2. According to the 3.0.1 spec, it's valid to have schema reference (the $ref value) under the requestBody/content/<media-type>/schema object instead of the properties object. However, the current codebase only looks after the properties object.

    foreach (var property in RequestBody.Content.First().Value.Schema.Properties)

Therefore, these two issues need to be resolved for proper V3 ➡️ V2 conversion. The Azure Functions OpenAPI extension has addressed this issue, which relies on this OpenAPI.NET package.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daysMedium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daystype:bugA broken experienceA broken experience

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.