Post request using multipart/form-data and Open API 3.0.1

Eivind Schrødahl 30 Reputation points
2023-11-08T13:08:29.52+00:00

I see this question may have been raised several times over the years. But I will give it a go.

I have created an OpenAPI Specification and imported it to APIM. One of my Post methods is using multipart/form-data so that I can define both normal data properties as well as a string property formatted as binary allowing me to add attachments. This works grate when I look at the API Specification in Swagger, however as soon as I import it to APIM the post-path response schema is modified by APIM. Ideally, I want the multipart/form-data to look at the referenced component schema. But since its being modified the schema properties are copied into the path definition and the property for attachment does not have type definition (binary) as it had before import.

I really need this post method to allow attaching files, so I’m reaching out to this community to try finding an alternative solution and also see if someone knows if the APIM team is still working on making this supported for OpenAPI 3.x?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,536 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 18,341 Reputation points
    2023-11-13T14:24:06.5+00:00

    Eivind Schrødahl Currently, while importing Open API, fields such as content -> format, required etc. (may include other fields also) are being ignored when Content-Type is multipart/form-data. This is a known issue that our product team is aware of and working on it (similar discussion). Unfortunately, we don't have a workaround at this moment and will keep other thread updated on the latest. Sorry for the inconvenience caused by this issue.

    I hope this helps and let me know if any questions.


    If you found the answer to your question helpful, please take a moment to mark it as Yes for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful