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

Swagger UI is not able to submit form data with file attachment & JSON parameter #3311

Closed
mobasherswl opened this issue May 15, 2020 · 0 comments
Labels
Milestone

Comments

@mobasherswl
Copy link

Hi, i am using springfox version 2.9.2. I have setup spring boot v2.2.6 project with rest controllers. One of the rest controllers has following endpoint:
@PostMapping(path = "/create", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity create(final Principal principal, @RequestPart Ticket ticket, @RequestPart(required = false) final MultipartFile[] attachments)
The issue is that the correct parameter content type is not generated for the parameter ticket which is a JSON type. I have tried to search for the answer every where & tried to debug the code but so far I couldn't find any thing.

What's the correct way so that the content type for request if form data whereas the content type of parameter ticket is json & swagger ui is able to submit it? Please help me out.

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

No branches or pull requests

2 participants