Skip to content

Commit b9ab479

Browse files
committed
Adding docs for new forkProperties
1 parent f9835dd commit b9ab479

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ openApi {
7878
outputDir.set(file("$buildDir/docs"))
7979
outputFileName.set("swagger.json")
8080
waitTimeInSeconds.set(10)
81+
forkProperties.set("-Dspring.profiles.active=special")
8182
}
8283
```
8384

@@ -87,6 +88,30 @@ Parameter | Description | Required | Default
8788
`outputDir` | The output directory for the generated OpenAPI file | No | $buildDir - Your project's build dir
8889
`outputFileName` | The name of the output file with extension | No | openapi.json
8990
`waitTimeInSeconds` | Time to wait in seconds for your Spring Boot application to start, before we make calls to `apiDocsUrl` to download the OpenAPI doc | No | 30 seconds
91+
`forkProperites` | Any system property that you would normal need to start your spring boot application. Can either be a static string or a java Properties object | No | ""
92+
93+
### Fork properties examples
94+
Fork properties allows you to send in anything that might be necessary to allow for the forked spring boot application that gets started
95+
to be able to start (profiles, other custom properties, etc etc)
96+
97+
#### Static string
98+
```
99+
openApi {
100+
forkProperties = "-Dspring.profiles.active=special -DstringPassedInForkProperites=true"
101+
}
102+
```
103+
104+
#### Passing straight from gradle
105+
This allows for you to be able to just send in whatever you need when you generate docs.
106+
107+
`./gradlew clean generateOpenApiDocs -Dspring.profiles.active=special`
108+
109+
and as long as the config looks as follows that value will be passed into the forked spring boot application.
110+
```
111+
openApi {
112+
forkProperties = System.properties
113+
}
114+
```
90115

91116
# Building the plugin
92117

0 commit comments

Comments
 (0)