Open stoyo opened 3 years ago
The issue is with classes that have extra methods (in same or in parent class), that will be excluded from the swagger - because they do not have @Path
, @Api
nor @PostMapping
. Even if they are ignored from the operations, their model is added to the definitions.
In the next example the produced swagger contains #/definitions/SQLException
even if it is not used from the operations or from other definition:
// this static method and return type should not be included in the swagger as there is no Path nor Api
public static SQLException getCauseSQLException(Throwable e) {
return null;
}
The change happened between 3.1.5 and 3.1.6 as part of some fix for JAX-RS. Previously the extra definitions were not included in the resulting swagger.
I prepared a fix that returns the previously behaviour - hope it gets merged soon as it prevents upgrading to newer version of swagger-maven-plugin in our project.
Bump of swagger-maven-plugin from 3.1.5 to 3.1.8 is not backward compatible.
All annotations in my web service look like this:
None of the provided response classes (i.g.
FooTracker
in the example above) include in any way CompletableFuture or Thread class, however, in swagger models section, after bump, I started seeing:I saw that this issue: https://github.com/kongchen/swagger-maven-plugin/issues/782 mentions the exact same problem, however, it has been closed without any explanation or comment from anyone.