Description
Springdoc version: 1.6.11
As of OAI/OpenAPI-Specification#2117, body in GET-HEAD-DELETE now supported in OAS 3.1.0
Even I set open api version to 3.1 in properties;
springdoc:
api-docs:
version: openapi_3_1
org.springdoc.webmvc.api.OpenApiResource#openapiJson still creates documentation in legacy structure. I would like to see support of "requestBody" in GET, in springdoc codes.
There are 2 blocking logics exist in AbstractRequestService;
-
org.springdoc.core.AbstractRequestService#isRequestBodyParam (which is blocking GET)
-
org.springdoc.core.AbstractRequestService.java:308 (which is an if logic for GET)
If I override those logics with copying some of code, replacing RequestService with new custom one, everything works fine :) I can create something like this;
"/api/tests/getmebody" : {
"get" : {
"tags" : [ "Test" ],
"operationId" : "getMeBody",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/NewRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/Response"
}
}
}
}
}
}
}
What do you think? Can we improve AbstractRequestService to generate openapi spec correctly?
Thanks.