Skip to content

Commit 52b9a1e

Browse files
authored
docs: release 1.12.0 (#104)
* docs: prepare 1.12.0 release * docs: prepare 1.12.0 release * docs: prepare 1.12.0 release * docs: prepare 1.12.0 release
1 parent d859d95 commit 52b9a1e

17 files changed

+12535
-20428
lines changed

docs/configuration/documenting-bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ You can define anything and there is no validation.
8080
```
8181

8282
:::info
83-
See [Add-Ons / Generic Annotation Binding](../add-ons#generic-binding) for more information
83+
See [Add-Ons / Generic Annotation Binding](../introduction/add-ons.mdx#generic-binding) for more information
8484
:::
8585

8686
## Binding properties

docs/configuration/documenting-messages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,5 @@ static class StringEnvelope {
137137
```
138138

139139
:::info
140-
See [Add-Ons](../add-ons) for more information on how to document other formats
140+
See [Add-Ons](../introduction/add-ons) for more information on how to document other formats
141141
:::

docs/faq.md

Lines changed: 34 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,9 @@ Either create a custom spring controller to serve the file or [serve static reso
2020

2121
Note: `springwolf-ui` doesn't support the full AsyncAPI spec.
2222

23-
### Unit test verification
23+
### Springwolf in unit / integration test
2424

25-
With the AsyncAPI artifact checked into the repository at `src/test/resources/asyncapi.json`,
26-
a unit test can verify that the current code still matches the expected AsyncAPI specification.
27-
Additionally, a diff reveals (un)expected changes.
28-
29-
Example unit test:
30-
31-
```java
32-
@SpringBootTest(
33-
classes = {SpringwolfKafkaExampleApplication.class},
34-
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
35-
class ApiIntegrationTest {
36-
37-
@Autowired
38-
private TestRestTemplate restTemplate;
39-
40-
@Test
41-
void asyncApiResourceArtifactTest() throws IOException {
42-
String url = "/springwolf/docs";
43-
String actual = restTemplate.getForObject(url, String.class);
44-
45-
// writing the actual file can be useful for debugging (remember: gitignore)
46-
Files.writeString(Path.of("src", "test", "resources", "asyncapi.actual.json"), actual);
47-
48-
InputStream s = this.getClass().getResourceAsStream("/asyncapi.json");
49-
String expected = new String(s.readAllBytes(), StandardCharsets.UTF_8).trim();
50-
51-
assertEquals(expected, actual);
52-
}
53-
}
54-
```
55-
56-
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).
5726

5827
## Troubleshooting
5928

@@ -100,18 +69,23 @@ Be sure to enable fully qualified names ([`use-fqn`](configuration/configuration
10069
10170
Spring Security allows to limit access to authorized users.
10271
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`)
10773
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).
11175
11276
### Only one of multiple classes with the same name (different package) is detected
11377
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 class name (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).
11589

11690
### Generic types (List) don't contain item properties
11791

@@ -133,6 +107,25 @@ class ListWrapper extends ArrayList<String> {}
133107
public void sendMessage(ListWrapper<String> msg) {}
134108
```
135109

110+
### Consumers are detected multiple times (with different payloads)
111+
112+
When Springwolf finds multiple consumers/producers for the same channel/topic, these are merged together.
113+
This is expected, as there are use-cases where different payloads are sent via the same channel/topic.
114+
115+
Springwolf uses on scanners to find all consumer and producers in your application.
116+
Most likely two scanners found your consumer/producer each.
117+
See [configuration](configuration/configuration.mdx) to disable scanners.
118+
119+
## Usage Patterns
120+
121+
### How to access the generated documentation within java
122+
123+
Use the `AsyncApiService` to access the generated documentation.
124+
125+
### How to customize the generated documentation
126+
127+
See the [customization page](configuration/customizing.md)
128+
136129
## Release Notes / Migration Guide / Updating / Upgrading
137130

138131
Releases are managed in [GitHub Releases](https://github.com/springwolf/springwolf-core/releases),
@@ -160,33 +153,3 @@ Last versions to support Spring Boot 2.X:
160153
- `springwolf-core:0.6.0`
161154
- `springwolf-kafka:0.10.0`
162155
- `springwolf-ui:0.6.0`
163-
164-
## Usage Patterns
165-
166-
### How to access the generated documentation within java
167-
168-
Use the `AsyncApiService` to access the generated documentation.
169-
170-
### How to generate the documentation at build time
171-
172-
#### With Gradle
173-
174-
You can use the [`springdoc-openapi-gradle-plugin`](https://github.com/springdoc/springdoc-openapi-gradle-plugin) and configure the plugin
175-
for Springwolf by pointing it to the Springwolf docs endpoint:
176-
177-
```groovy
178-
openApi {
179-
apiDocsUrl = "http://localhost:8080/springwolf/docs"
180-
outputDir = file("$buildDir/docs")
181-
outputFileName = "async-api.json"
182-
}
183-
```
184-
185-
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)
192-
properties can help you.

docs/add-ons.mdx renamed to docs/introduction/add-ons.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 50
2+
sidebar_position: 20
33
---
44
import Tabs from '@theme/Tabs';
55
import TabItem from '@theme/TabItem';
@@ -49,7 +49,7 @@ Adding a model converter is demoed in [`springwolf-add-ons/springwolf-common-mod
4949
</Tabs>
5050
Latest version: ![Maven Central](https://img.shields.io/maven-central/v/io.github.springwolf/springwolf-json-schema?color=green&label=springwolf&style=plastic)
5151

52-
Specific bindings are provided for the different [supported protocols](introduction/supported-protocols) but if you need
52+
Specific bindings are provided for the different [supported protocols](supported-protocols) but if you need
5353
to document a protocol that's not support yet, you can use this generic binding and specify any property you need.
5454

5555
### `@AsyncGenericOperationBinding`
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation 'io.github.springwolf:springwolf-common-model-converters:1.11.0'
2+
implementation 'io.github.springwolf:springwolf-common-model-converters:1.12.0'
33
}

docs/snippets/_springwolf_common_model_converters_maven.xml renamed to docs/introduction/snippets/_springwolf_common_model_converters_maven.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<dependency>
33
<groupId>io.github.springwolf</groupId>
44
<artifactId>springwolf-common-model-converters</artifactId>
5-
<version>1.11.0</version>
5+
<version>1.12.0</version>
66
</dependency>
77
</dependencies>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation 'io.github.springwolf:springwolf-generic-binding:1.11.0'
2+
implementation 'io.github.springwolf:springwolf-generic-binding:1.12.0'
33
}

docs/snippets/_springwolf_generic_binding_maven.xml renamed to docs/introduction/snippets/_springwolf_generic_binding_maven.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<dependency>
33
<groupId>io.github.springwolf</groupId>
44
<artifactId>springwolf-generic-binding</artifactId>
5-
<version>1.11.0</version>
5+
<version>1.12.0</version>
66
</dependency>
77
</dependencies>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation 'io.github.springwolf:springwolf-json-schema:1.11.0'
2+
implementation 'io.github.springwolf:springwolf-json-schema:1.12.0'
33
}

docs/snippets/_springwolf_json_schema_maven.xml renamed to docs/introduction/snippets/_springwolf_json_schema_maven.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<dependency>
33
<groupId>io.github.springwolf</groupId>
44
<artifactId>springwolf-json-schema</artifactId>
5-
<version>1.11.0</version>
5+
<version>1.12.0</version>
66
</dependency>
77
</dependencies>

0 commit comments

Comments
 (0)