Although this logic makes sense in some cases, I believe that using a Map as a request body is fairly common and should be supported, even when the request body is not required. As such, I’ve made an adjustment that ensures the request body will still be displayed when its type is Map.
I would love to hear your thoughts or feedback on this approach and whether you think it aligns with the project’s goals.
Fixes #2703
Problem Overview
In the example above, the request body is not displayed because it is marked as a parameter to ignore. This behavior stems from the fact that the request body is both optional and of type
java.util.Map
. The relevant code can be found here: https://github.com/springdoc/springdoc-openapi/blob/03349cff6a2480555c746cf560f7d14272c93331/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java#L451-L457https://github.com/springdoc/springdoc-openapi/blob/03349cff6a2480555c746cf560f7d14272c93331/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java#L141
Although this logic makes sense in some cases, I believe that using a
Map
as a request body is fairly common and should be supported, even when the request body is not required. As such, I’ve made an adjustment that ensures the request body will still be displayed when its type isMap
.I would love to hear your thoughts or feedback on this approach and whether you think it aligns with the project’s goals.