This project is organized as a monorepo with the following Maven modules:
kotlin-asyncapi-core
kotlin-asyncapi-maven-plugin
kotlin-asyncapi-script
kotlin-asyncapi-spring-web
The core module provides the Kotlin DSL for building the AsyncAPI POJO. This POJO model can be serialized to the AsyncAPI definition JSON.
Every module in this project depends on the core. The core module itself is independent of the rest of the project and does not depend on any other module.
The annotation module defines technology-agnostic annotations that represent a subset of the core model.
The script module configures the context for the asyncapi.kts
script and defines compilation properties for the Kotlin compiler. It tells the compiler what the script environment should look like.
The maven plugin executes the asyncapi.kts
script and adds the resulting AsyncAPI definition JSON file to the project resources. This file can be picked up and extended by the spring-web
module.
The spring-web module glues everything together to build and serve the AsyncAPI definition for a Spring Boot microservice.
The controller provides an endpoint that returns the cached AsyncAPI definition.
The service creates an empty AsyncAPI model and uses the registered extensions to extend it.
The extensions add or override properties of an AsyncAPI model.
The providers provide AsyncAPI data from the application context (e.g. default values). The data can be used to extend an AsyncAPI model.