springdoc-openapi-gradle-plugin
springdoc-openapi-gradle-plugin copied to clipboard
Support for `bootTestRun` task
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.
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
}
}