We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have created controller with optional RequestBody. I added RequestBody but description not shown in the generated Swagger UI.
Controller snippet:
import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.responses.ApiResponse import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RestController import java.util.UUID @RestController class HelloController { @PostMapping("/hello") @Operation(summary = "Say hello", requestBody = io.swagger.v3.oas.annotations.parameters.RequestBody( description = "Map uid -> string)", required = false ), responses = [ ApiResponse(responseCode = "200", description = "Ok"), ]) fun hello(@RequestBody(required = false) body: Map<UUID, String>?): ResponseEntity<*> { return ResponseEntity.ok().build<Any>() } }
How Swagger UI looks:
Actual OpenAPI Description json: hello":{"post":{"tags":["hello-controller"],"summary":"Say hello","operationId":"hello","requestBody":{"description":"Map uid -> string)"},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"object"}}}}}}},
hello":{"post":{"tags":["hello-controller"],"summary":"Say hello","operationId":"hello","requestBody":{"description":"Map uid -> string)"},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"object"}}}}}}},
Expected behavior: Request body shown
Actual behavior: Request body not shown
Spring boot: 3.2.2 Spring doc: 2.6.0
The text was updated successfully, but these errors were encountered:
Facing the same issue, please fix it. Otherwise, it becomes hard to communicate with the frontend developers.
Sorry, something went wrong.
Display nullable request body with map type. Fixes springdoc#2703
320a99a
d718888
ad86c0a
Successfully merging a pull request may close this issue.
I have created controller with optional RequestBody. I added RequestBody but description not shown in the generated Swagger UI.
Controller snippet:
How Swagger UI looks:

Actual OpenAPI Description json:
hello":{"post":{"tags":["hello-controller"],"summary":"Say hello","operationId":"hello","requestBody":{"description":"Map uid -> string)"},"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"type":"object"}}}}}}},
Expected behavior:
Request body shown
Actual behavior:
Request body not shown
Spring boot: 3.2.2
Spring doc: 2.6.0
The text was updated successfully, but these errors were encountered: