Skip to content

Commit b788634

Browse files
authored
Merge pull request #16 from sam0r040/chore/add_documentation_on_how_to_generate_documentation_at_build_time
Add documentation on how to generate springwolf async api spec at buildtime
2 parents 3a1695f + c5ba502 commit b788634

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/faq.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,27 @@ Spring Security allows to limit access to authorized users.
4848
### How to access the generated documentation within java?
4949

5050
Use the `AsyncApiService` to access the generated documentation.
51+
52+
### How to generate the documentation at build time?
53+
54+
#### With Gradle
55+
56+
You can use the [springdoc-openapi-gradle-plugin](https://github.com/springdoc/springdoc-openapi-gradle-plugin) and configure the plugin
57+
for springwolf by pointing it to the springwolf docs endpoint:
58+
59+
```groovy
60+
openApi {
61+
apiDocsUrl = "http://localhost:8080/springwolf/docs"
62+
outputDir = file("$buildDir/docs")
63+
outputFileName = "async-api.json"
64+
}
65+
```
66+
67+
The [springwolf-kafka-example](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/build.gradle)
68+
contains a working example.
69+
70+
The plugin will startup the spring boot application by using the `bootRun` task and then try to download the documentation
71+
from the given `apiDocsUrl` and store it in the `outputDir` and with the given `outputFileName`.
72+
73+
If your application is unable to start up with the bootRun task, see if [customBootRun](https://github.com/springdoc/springdoc-openapi-gradle-plugin#customization)
74+
properties can help you.

0 commit comments

Comments
 (0)