springdoc-openapi-gradle-plugin icon indicating copy to clipboard operation
springdoc-openapi-gradle-plugin copied to clipboard

Support for `bootTestRun` task

Open desiderantes opened this issue 9 months ago • 1 comments

Spring Boot 3.1.x added support for configuring Testcontainers for local development via a separate Main class in the test source set, and a separate task called bootTestRun that executes with that main class. Seems like an ideal config for generating openapi definitions.

desiderantes avatar Feb 18 '25 01:02 desiderantes

As a workaround until it is supported more explicitly I was able to get it working for me by doing this:

openApi {
    customBootRun {
        mainClass = 'com.sidecarhealth.expservice.TestApplication'
        classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
    }
}

jgooley-sh avatar Apr 18 '25 03:04 jgooley-sh