Add-Ons
Common Model Converters
The springwolf-add-ons/springwolf-common-model-converters
adds support for different Model Converters.
These are needed when swagger is unable to extract a schema from a class.
Add the following dependency:
- Groovy
- Maven
dependencies {
implementation 'io.github.springwolf:springwolf-common-model-converters:1.8.0'
}
<dependencies>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-common-model-converters</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
Latest version:
javax.money.MonetaryAmount
Adding a model converter is demoed in springwolf-add-ons/springwolf-common-model-converters
Generic Binding
- Groovy
- Maven
dependencies {
implementation 'io.github.springwolf:springwolf-generic-binding:1.8.0'
}
<dependencies>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-generic-binding</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
Latest version:
Specific bindings are provided for the different supported protocols but if you need to document a protocol that's not support yet, you can use this generic binding and specify any property you need.
@AsyncGenericOperationBinding
The annotation parameter type
is expected to contain the id of a valid operation binding protocol
but no validation is done.
The annotation parameter fields
is intended to contain the fields that describe the protocol fields.
- Key-Value: A simple field can be described like
{"key-name=value"}
- Array: An array structure can be defined like
{"key=[valueA, valueB, valueC]"}
- Map: A map can be defined as
{"nested.keyA=value", "nested.keyB=value", "nested.keyC.subvalue=value"}
You can define anything and there is no validation.
@AsyncGenericOperationBinding(
type = "custom-binding",
fields = {
"internal-field=customValue",
"nested.key=nestedValue",
"listKey=[a,b,c,d,e]"
}
)
Json-Schema
The springwolf-add-ons/springwolf-json-schema
adds the json-schema schema to the AsyncAPI document.
Add the following dependency:
- Groovy
- Maven
dependencies {
implementation 'io.github.springwolf:springwolf-json-schema:1.8.0'
}
<dependencies>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-json-schema</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
Latest version:
Kotlinx Serialization
This add-on is still Beta so some features may not be yet implemented or some issues may be expected. Please, fill a Springwolf Issue if you find any bug or a missing feature.
To support Kotlinx Serialization classes, add the following dependency:
- Groovy
- Maven
dependencies {
implementation 'io.github.springwolf:springwolf-kotlinx-serialization-model-converter:1.8.0'
}
<dependencies>
<dependency>
<groupId>io.github.springwolf</groupId>
<artifactId>springwolf-kotlinx-serialization-model-converter</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
Latest version:
Using this add-on, any Kotlin class annotated with the @Serializable
annotation is properly converted to AsyncAPI specification.
The fields annotated with @SerialName
are named as defined in the annotation.