You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Using a Rest Controller from spring-boot, I want to annotate the parameter names and descriptions of several multi-part parts in a request
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
As far as I can see, only one @Parameter tag is read from all the @Parameter attached to the request parts
A reproducer is:
@Operation(summary = "Multiple files and JSON payloads as multi part request")
@PostMapping(
value = "multi",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
produces = MediaType.TEXT_PLAIN_VALUE)
publicStringmultiFilesInMultiPart(
@RequestPart("params")
@Parameter(
description = "This is the configuration",
content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
finalJsonRequestjsonRequest,
@RequestPart(value = "file1", required = false) @Parameter(description = "This is file1")
finalMultipartFilefile1,
@RequestPart(value = "file2", required = false) @Parameter(description = "This is file2")
finalMultipartFilefile2) {
return"Hello World " + jsonRequest.getName();
}
This is valid spring boot, deploys properly and can be queried with
curl -X POST "http://localhost:8080/multi" -H "accept: text/plain" -H "Content-Type: multipart/form-data" -F 'params={"name": "Bob"}'
Hello world Bob
What is the actual result using OpenAPI Description (yml or json)?
A clear and concise description of any alternative solutions or features you've considered.
I tried to add the description of @RequestPart in a @Parameter attached directly (as described), I also tried to attach it through @Operation:parameters with no luck.
Additional context
Add any other context or screenshots about the feature request here.
The swagger ui is as follows for the reference endpoint
The text was updated successfully, but these errors were encountered:
Hello
The linked commit has an integration test added,
see springdoc-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app119/HelloController.java
and other files in this folder.
Best regards.
Le dim. 31 oct. 2021 à 02:28, GoncaloAC ***@***.***> a écrit :
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Using a Rest Controller from spring-boot, I want to annotate the parameter names and descriptions of several multi-part parts in a request
As far as I can see, only one
@Parameter
tag is read from all the@Parameter
attached to the request partsA reproducer is:
This is valid spring boot, deploys properly and can be queried with
The corresponding yml shows that only one
@Parameter
description was processed,Describe the solution you'd like
I would like each part: params, file1, file2 to get assigned the description corresponding to what was declared in the
@Parameter
tag.Not sure, I assume a something like the following, but cannot say whether this is valid according to the spec.
Describe alternatives you've considered
I tried to add the description of
@RequestPart
in a@Parameter
attached directly (as described), I also tried to attach it through@Operation:parameters
with no luck.Additional context
The swagger ui is as follows for the reference endpoint

The text was updated successfully, but these errors were encountered: