swagger-core
                                
                                 swagger-core copied to clipboard
                                
                                    swagger-core copied to clipboard
                            
                            
                            
                        OpenAPIExtension's are not loaded by swagger-gradle-plugin
swagger-gradle-plugin does not load io.swagger.v3.jaxrs2.ext.OpenAPIExtension classes.
The code in io.swagger.v3.jaxrs2.ext.OpenAPIExtensions uses ServiceLoader.load(OpenAPIExtension.class) to load extensions. The problem is that ServiceLoader uses Thread.currentThread().getContextClassLoader() when a ClassLoader is not specified which cannot see the META-INF\services files from within a gradle plugin.
Using ServiceLoader.load(OpenAPIExtension.class, OpenAPIExtensions.class.getClassLoader()) should load services correctly.
bump
I, too, am hitting this particular issue. I am attempting to use the Gradle plugin as a means of auto-generating the spec in order to provide an API diff on PRs. We use an OpenAPIExtension as a means of parsing our custom auth annotations and adding both the associated ApiResponse objects and the security scheme to the operation.
Being unable to generate the spec via the Gradle plugin means that diffing our API spec requires booting our Java application, querying the endpoint, and then generating a diff. Ultimately, it wastes several precious CI minutes on every PR commit's status checks.