Skip to content

Commit

Permalink
Micronaut openapi: fix set fluxForArrays and invokerPackage properties
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 committed Aug 24, 2024
1 parent 83dd069 commit 09616ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ public void execute() {
.map(MicronautCodeGeneratorEntryPoint.OutputKind::of)
.toArray(MicronautCodeGeneratorEntryPoint.OutputKind[]::new)
)
.withOptions(options -> options.withInvokerPackage(parameters.getInvokerPackageName().get())
.withOptions(options -> options
.withLang("kotlin".equalsIgnoreCase(lang) ? GeneratorLanguage.KOTLIN : GeneratorLanguage.JAVA)
.withApiPackage(parameters.getApiPackageName().get())
.withModelPackage(parameters.getModelPackageName().get())
.withInvokerPackage(parameters.getInvokerPackageName().get())
.withBeanValidation(parameters.getUseBeanValidation().get())
.withUseOneOfInterfaces(parameters.getUseOneOfInterfaces().get())
.withOptional(parameters.getUseOptional().get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ protected void configureBuilder(MicronautCodeGeneratorBuilder builder) {
spec.withAuthorization(parameters.getUseAuth().get())
.withAdditionalClientTypeAnnotations(parameters.getAdditionalClientTypeAnnotations().getOrElse(List.of()))
.withGeneratedAnnotation(parameters.getGeneratedAnnotation().get())
.withFluxForArrays(parameters.getFluxForArrays().get())
.withKsp(parameters.getKsp().get());

if (parameters.getClientId().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ protected void configureBuilder(MicronautCodeGeneratorBuilder builder) {
var parameters = getParameters();

if ("kotlin".equalsIgnoreCase(parameters.getLang().get())) {
builder.forKotlinServer(spec -> spec.withControllerPackage(parameters.getControllerPackage().get())
builder.forKotlinServer(spec -> spec
.withControllerPackage(parameters.getControllerPackage().get())
.withAuthentication(parameters.getUseAuth().get())
.withAot(parameters.getAot().get())
.withGenerateImplementationFiles(false)
.withGenerateControllerFromExamples(false)
.withGenerateOperationsToReturnNotImplemented(false)
.withGeneratedAnnotation(parameters.getGeneratedAnnotation().get())
.withFluxForArrays(parameters.getFluxForArrays().get())
.withKsp(parameters.getKsp().get())
);
} else {
builder.forJavaServer(spec -> spec.withControllerPackage(parameters.getControllerPackage().get())
builder.forJavaServer(spec -> spec
.withControllerPackage(parameters.getControllerPackage().get())
.withAuthentication(parameters.getUseAuth().get())
.withAot(parameters.getAot().get())
.withGenerateImplementationFiles(false)
Expand Down

0 comments on commit 09616ae

Please sign in to comment.