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
When Groovy is on the classpath at the same time as springdoc-openapi-starter-webmvc-ui, Map fields do not show up in the generated Open API spec (and therefore, they also don't show up in the Swagger UI). This happens just when Groovy is on the classpath, even if we are not using it.
In the example below, when it works (without Groovy on the classpath), both fields show up in the spec/UI. But adding Groovy causes the Map field to disappear from both.
Reproducing the Issue
For example, if I have this model class, TestRequest.java with two fields and basic getters/setters:
importio.swagger.v3.oas.annotations.media.Schema;
importjava.util.Map;
publicclassTestRequest {
@Schema(description = "Joe was here with a tuna melt!")
privateStringjoeWasHere;
@Schema(description = "This is an example of a map that does not work.!")
privateMap<String, String> testingTheMap;
publicStringgetJoeWasHere() { returnjoeWasHere; }
publicvoidsetJoeWasHere(StringjoeWasHere) { this.joeWasHere = joeWasHere; }
publicMap<String, String> getTestingTheMap() { returntestingTheMap; }
publicvoidsetTestingTheMap(Map<String, String> testingTheMap) { this.testingTheMap = testingTheMap; }
}
And a controller that doesn't do much but have one endpoint that takes this request class as a request body (although the same problem applies to responses and other spec generation):
But the exact same project does not work if I simply add org.apache.groovy:groovy:4.0.7 to the classpath (and make no other changes). I have confirmed that the issue seems to also exist for 2.0.0 and 2.0.1 of the springdoc-openapi-starter-webmvc-ui modules, and that the problem also exists if I downgrade Groovy to 4.0.6.
I'll also note that this problem doesn't occur if you use the exact same code and Groovy version, but downgrade to Spring-Boot 2.7.7 and springdoc-openapi-ui 1.6.14. So it seems this issue is new with SpringDoc 2.X.
The text was updated successfully, but these errors were encountered:
Issue Description
When Groovy is on the classpath at the same time as springdoc-openapi-starter-webmvc-ui, Map fields do not show up in the generated Open API spec (and therefore, they also don't show up in the Swagger UI). This happens just when Groovy is on the classpath, even if we are not using it.
In the example below, when it works (without Groovy on the classpath), both fields show up in the spec/UI. But adding Groovy causes the Map field to disappear from both.
Reproducing the Issue
For example, if I have this model class, TestRequest.java with two fields and basic getters/setters:
And a controller that doesn't do much but have one endpoint that takes this request class as a request body (although the same problem applies to responses and other spec generation):
This works fine if I run this application with just these two dependencies:
But the exact same project does not work if I simply add
org.apache.groovy:groovy:4.0.7
to the classpath (and make no other changes). I have confirmed that the issue seems to also exist for 2.0.0 and 2.0.1 of the springdoc-openapi-starter-webmvc-ui modules, and that the problem also exists if I downgrade Groovy to 4.0.6.I'll also note that this problem doesn't occur if you use the exact same code and Groovy version, but downgrade to Spring-Boot 2.7.7 and springdoc-openapi-ui 1.6.14. So it seems this issue is new with SpringDoc 2.X.
The text was updated successfully, but these errors were encountered: