Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Swagger Error: Not a valid parameter definition for Multi part file type #616

Open
27081988 opened this issue Feb 6, 2020 · 0 comments
Open

Comments

@27081988
Copy link

27081988 commented Feb 6, 2020

I'm trying to generate swagger document for my API's .
Every time I get "Swagger Error: Not a valid parameter definition." when paste json into swagger editor.
When I checked generated json it contains "ref" instead of "file".
I tried following options but none of them works.
@ApiImlicitParams(value={ @ApiImlicitParam=(paramType=form, name=file, value="file", required=true, dataType="file"})
or
@ApiImlicitParams(value={ @ApiImlicitParam=(paramType=formData, name=file, value="file", required=true, dataType="file"})
or
@ApiImlicitParams(value={ @ApiImlicitParam=(paramType=form, name=file, value="file", required=true, dataType="_file"})
or
@ApiImlicitParams(value={ @ApiImlicitParam=(paramType=form, name=file, value="file", required=true, dataType="java.io.InputStream"})
or
@ApiImlicitParams(value={ @ApiImlicitParam=(paramType=form, name=file, value="file", required=true, dataType="MultipartFile"})

method(@RequestPart(value= "file", required=true) MultipartFile file)

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

No branches or pull requests

1 participant