You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a full example, check the [springwolf-kafka-example ApiIntegrationTest](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java)
25
+
See [Static Generation](static-generation.md).
57
26
58
27
## Troubleshooting
59
28
@@ -100,18 +69,23 @@ Be sure to enable fully qualified names ([`use-fqn`](configuration/configuration
100
69
101
70
Spring Security allows to limit access to authorized users.
102
71
103
-
### Consumers are detected multiple times (with different payloads)
104
-
105
-
When Springwolf finds multiple consumers/producers for the same channel/topic, these are merged together.
106
-
This is expected, as there are use-cases where different payloads are sent via the same channel/topic.
72
+
### Classes have fully qualified names (`io.springwolf.package.ClassName`)
107
73
108
-
Springwolf uses on scanners to find all consumer and producers in your application.
109
-
Most likely two scanners found your consumer/producer each.
110
-
See [configuration](configuration/configuration.mdx) to disable scanners.
74
+
Disable the [fully qualified class name (FQN) option (`springwolf.use-fqn=false`)](configuration/configuration.mdx).
111
75
112
76
### Only one of multiple classes with the same name (different package) is detected
113
77
114
-
Enable the fully qualified class name (FQN) option (`springwolf.use-fqn=true`) so that Springwolf uses the FQN internally.
78
+
Enable the [fully qualified class name (FQN) option (`springwolf.use-fqn=true`)](configuration/configuration.mdx).
79
+
80
+
### Springwolf interferes with OpenAPI documentation
81
+
82
+
Springwolf uses `swagger-core` to analyze classes, which is used by some OpenAPI libraries like `springdoc-openapi`.
83
+
`swagger-core` configuration is partly global and can't be isolated.
84
+
85
+
Options:
86
+
87
+
1.Use the same settings in Springwolf and the other library (including the [fully qualified classname (FQN) option](configuration/configuration.mdx)).
88
+
2. Don't run Springwolf and the other library at the same time, for example by [generating the documentation at build time](static-generation.md).
The [`springwolf-kafka-example`](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/build.gradle)
186
-
contains a working example.
187
-
188
-
The plugin will startup the spring boot application by using the `bootRun` task and then try to download the documentation
189
-
from the given `apiDocsUrl` and store it in the `outputDir` and with the given `outputFileName`.
190
-
191
-
If your application is unable to start up with the `bootRun` task, see if [customBootRun](https://github.com/springdoc/springdoc-openapi-gradle-plugin#customization)
See [Add-Ons / Generic Annotation Binding](../add-ons#generic-binding)
51
+
See [Add-Ons / Generic Annotation Binding](add-ons.mdx#generic-binding)
52
52
:::
53
53
54
54
## Wire format (Data serialization)
@@ -64,7 +64,7 @@ Besides the classical JSON events, Springwolf has best-effort support for some o
64
64
[Protobuf](https://protobuf.dev) is demoed in [kafka example](#native-support).
65
65
66
66
To remove the fields generated by the Protobuf class generated, add a `ModelResolver` bean, which uses the `ProtobufModule` to your project.
67
-
See [ObjectMapperConfiguration](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/configuration/ObjectMapperConfiguration.java) for details.
67
+
See [ProtobufConfiguration](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/main/java/io/github/springwolf/examples/kafka/configuration/ProtobufConfiguration.java) for details.
Users tend to start out with running Springwolf at runtime as part of the Spring Boot application context.
8
+
Still, it's possible to generate the AsyncAPI documentation statically at build time.
9
+
10
+
One use-case is to protect against unexpected API changes using a test.
11
+
For this, the expected `asyncapi.json` file is stored in the VCS repository.
12
+
13
+
## Spring Boot Test (full spring context)
14
+
15
+
The most simple way is a Spring Boot test (taken from [springwolf-kafka-example](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/ApiIntegrationTest.java)):
Especially for large application, starting the full Spring Boot context can be slow.
49
+
Springwolf _standalone_ uses a minimal Spring application context, by only including beans and configurations marked with `@StandaloneConfiguration`.
50
+
51
+
Demo code (taken from [`springwolf-kafka-example`](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/src/test/java/io/github/springwolf/examples/kafka/StandaloneTest.java)):
By default, only the `io.github.springwolf` package is scanned and `@StandaloneConfiguration` in other packages are _not_ picked up.
79
+
Use the `DefaultStandaloneApplication.builder()` to customize the Spring environment, load custom beans and configurations.
80
+
81
+
The [`application.properties` configuration](configuration/configuration.mdx) is picked up.
82
+
83
+
## Gradle Plugin (full spring context)
84
+
85
+
You can use the [`springdoc-openapi-gradle-plugin`](https://github.com/springdoc/springdoc-openapi-gradle-plugin) and configure the plugin
86
+
for Springwolf (taken from [`springwolf-kafka-example`](https://github.com/springwolf/springwolf-core/blob/master/springwolf-examples/springwolf-kafka-example/build.gradle)):
The plugin will start up the spring boot application by using the `bootRun` task and then try to download the documentation
97
+
from the given `apiDocsUrl` and store it in the `outputDir` and with the given `outputFileName`.
98
+
99
+
If your application is unable to start up with the `bootRun` task, see if [customBootRun](https://github.com/springdoc/springdoc-openapi-gradle-plugin#customization)
0 commit comments