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

File upload not rendering #185

Closed
mebibou opened this issue May 17, 2020 · 5 comments
Closed

File upload not rendering #185

mebibou opened this issue May 17, 2020 · 5 comments

Comments

@mebibou
Copy link

mebibou commented May 17, 2020

I am using swagger-jsdoc to define my swagger paths and on one particular endpoint I need to do file upload. The swagger doc looks like this:

/**
 * @swagger
 *
 * paths:
 *   /files:
 *     post:
 *       summary: Upload files for processing
 *       requestBody:
 *         required: true
 *         content:
 *           multipart/form-data:
 *             schema:
 *               type: object
 *               properties:
 *                 file:
 *                   type: array
 *                   items:
 *                     type: string
 *                     format: binary
 *       responses:
 *         200:
 *           $ref: '#/components/responses/NoContent'
 *         401:
 *           $ref: '#/components/responses/UnauthorizedError'
 *         500:
 *           $ref: '#/components/responses/UnexpectedError'
 */

When I hit "Try It Out" in swagger UI, I have a warning in the console Could not find component: JsonSchema_string_binary and the UI does not show an input to choose files:

Screen Shot 2020-05-17 at 9 33 34 AM

@BePo65
Copy link

BePo65 commented Jun 7, 2020

Oh, i do also wait for the solutuion to this problem.

I think that this is the known problem solved in swagger-api/swagger-ui issue #4600 . To transfer this solution to this package here, the dependeny 'swagger-ui-dist' should be updated to v3.26.0 (the latest release).

@mebibou
Copy link
Author

mebibou commented Jun 8, 2020

@BePo65 thanks, npm install swagger-ui-dist@latest will work for now until a new release with update dist is available

BePo65 added a commit to BePo65/swagger-ui-express that referenced this issue Jun 9, 2020
BePo65 added a commit to BePo65/swagger-ui-express that referenced this issue Feb 23, 2021
@KeitelDOG
Copy link

KeitelDOG commented Sep 19, 2021

Is this solved? Cause I'm using latest version"swagger-ui-express": "^4.1.6" and it still does not parse files correctly.

Should I add swagger-ui-dist@latest while waiting?

EDIT -
I just checked in 4.1.6 package, and it's not released yet with "swagger-ui-dist": "^3.26.0", it's still on "swagger-ui-dist": "^3.18.1".

@scottie1984
Copy link
Owner

Please use npm install --save swagger-ui-dist@latest

When installing swagger-ui-express it will pull in the latest version of swagger-ui-dist.

@NaturalAI-InspireXT
Copy link

This problem still persists, with the following packages

{
"swagger-jsdoc": "^6.0.8",
"swagger-ui-express": "^4.1.6"
}

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

5 participants