Class AsyncApiExtension

java.lang.Object
io.asyncapi.generator.AsyncApiExtension

public abstract class AsyncApiExtension extends Object
DSL extension that configures the AsyncAPI code generator.
 asyncApi {
     inputFile        = file("src/main/resources/asyncapi.yaml")
     basePackage      = "com.example.asyncapi"
     generateKafkaConfig = true
     useLombok        = true
 }
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    AsyncApiExtension(org.gradle.api.Project project)
    Constructs the extension with sensible defaults derived from the project.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    Base Java package for all generated sources.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether to generate a AsyncApiKafkaConfig Spring @Configuration bean with pre-configured producer/consumer factories.
    abstract org.gradle.api.file.RegularFileProperty
    Path to the AsyncAPI spec file (YAML or JSON, AsyncAPI 3.x format).
    abstract org.gradle.api.provider.Property<Boolean>
    Whether to annotate generated model classes with Lombok (@Data, @Builder, @NoArgsConstructor, @AllArgsConstructor).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AsyncApiExtension

      @Inject public AsyncApiExtension(org.gradle.api.Project project)
      Constructs the extension with sensible defaults derived from the project.
      Parameters:
      project - the Gradle project this extension is applied to
  • Method Details

    • getInputFile

      public abstract org.gradle.api.file.RegularFileProperty getInputFile()
      Path to the AsyncAPI spec file (YAML or JSON, AsyncAPI 3.x format). Defaults to src/main/resources/asyncapi.yaml.
      Returns:
      file property pointing to the spec
    • getBasePackage

      public abstract org.gradle.api.provider.Property<String> getBasePackage()
      Base Java package for all generated sources. Defaults to <project.group>.asyncapi, or com.example.asyncapi if the project group is not set.
      Returns:
      string property for the base package
    • getGenerateKafkaConfig

      public abstract org.gradle.api.provider.Property<Boolean> getGenerateKafkaConfig()
      Whether to generate a AsyncApiKafkaConfig Spring @Configuration bean with pre-configured producer/consumer factories. Defaults to true.
      Returns:
      boolean property
    • getUseLombok

      public abstract org.gradle.api.provider.Property<Boolean> getUseLombok()
      Whether to annotate generated model classes with Lombok (@Data, @Builder, @NoArgsConstructor, @AllArgsConstructor). When false, plain getters and setters are generated instead. Defaults to true.
      Returns:
      boolean property