Skip to content
New issue

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

multipart/form-data is converted incorrectly #60

Open
we-zhang opened this issue Jan 11, 2021 · 2 comments
Open

multipart/form-data is converted incorrectly #60

we-zhang opened this issue Jan 11, 2021 · 2 comments

Comments

@we-zhang
Copy link

we-zhang commented Jan 11, 2021

Swagger 2.0 multipart/form-data defined as below:

consumes:
       - multipart/form-data
     produces:
       - application/json
     parameters:
       - type: file
         name: artifact
         in: formData
         required: true
       - type: file
         name: metadata
         in: formData

And after converting, in OAS 3, it becomes:

requestBody:
       content:
         multipart/form-data:
           schema:
             required:
               - artifact
             properties:
               artifact:
                 type: string
                 format: binary
               metadata:
                 type: string
                 format: binary

Under schema section, missing type: object property. It should be:

     requestBody:
       content:
         multipart/form-data:
           schema:
             type: object
             required:
               - artifact
             properties:
               artifact:
                 type: string
                 format: binary
               metadata:
                 type: string
                 format: binary
@Venkat2382
Copy link

Any update on this? facing the same issue , any work arounds?

@RockyMM
Copy link

RockyMM commented Apr 21, 2022

The fix is in swagger-api/swagger-parser#1713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants