AxenAPI / axenapi-generator

AxenAPI Generator - generate code by OpenaAPI specification. Is used in AxenAPI Gradle Plugin
Apache License 2.0
6 stars 1 forks source link

Add Axenapi-generator as a classpath. First steps: 1) Add Axenapi-generator in classpath like this

buildscript {
    dependencies {
        classpath "pro.axenix-innovation:axenapi-generator:1.0.2-SNAPSHOT"
    }
}

2) Add openapi-generator (you can use another version of generator)

plugins {
    id "org.openapi.generator" version '7.0.0'
}

3) Add configuration for openapiGenerate. Use "kafka-codegen" as "generatorName".

openApiGenerate {
    generatorName = "kafka-codegen"
    inputSpec = getProjectDir().getAbsolutePath() + '/src/main/resources/joker.json'
    outputDir = getProjectDir().getAbsolutePath() + '/build'
    globalProperties = [
            apis           : "",
            models         : "",
            supportingFiles: 'ApiUtil.java'
    ]
    skipOverwrite = true
    configOptions = [
            useSpringBoot3 : "true",
            listenerPackage: 'axenapi.generated',
            modelPackage   : 'axenapi.generated.model',
            kafkaClient    : "false",
            interfaceOnly  : "false",
            useSpring3     : "false",
            resultWrapper  : "java.util.concurrent.CompletableFuture"
    ]
}