From 6e6c3e1e883f04dc9d1c6758a619176fb65e0647 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 26 Jun 2023 10:46:57 +0200 Subject: [PATCH 1/3] Make abstract code generator public Without this, it isn't possible for 3rd parties to implement their own code generator. --- .../openapi/generator/AbstractMicronautJavaCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi-generator/src/main/java/io/micronaut/openapi/generator/AbstractMicronautJavaCodegen.java b/openapi-generator/src/main/java/io/micronaut/openapi/generator/AbstractMicronautJavaCodegen.java index 6e505e981e..f379b00976 100644 --- a/openapi-generator/src/main/java/io/micronaut/openapi/generator/AbstractMicronautJavaCodegen.java +++ b/openapi-generator/src/main/java/io/micronaut/openapi/generator/AbstractMicronautJavaCodegen.java @@ -51,7 +51,8 @@ import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE; -abstract class AbstractMicronautJavaCodegen extends AbstractJavaCodegen implements BeanValidationFeatures, OptionalFeatures, MicronautCodeGenerator { +@SuppressWarnings("checkstyle:DesignForExtension") +public abstract class AbstractMicronautJavaCodegen extends AbstractJavaCodegen implements BeanValidationFeatures, OptionalFeatures, MicronautCodeGenerator { public static final String OPT_TITLE = "title"; public static final String OPT_TEST = "test"; From b79d266130171f4ab70b79c1692d798aacc2e5f7 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 26 Jun 2023 10:56:47 +0200 Subject: [PATCH 2/3] Make OpenAPI an API dependency That's required because AbstractMicronautJavaCodegen extends from a type in that API. --- openapi-generator/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi-generator/build.gradle b/openapi-generator/build.gradle index 8f9606df94..6cee40df13 100644 --- a/openapi-generator/build.gradle +++ b/openapi-generator/build.gradle @@ -11,7 +11,7 @@ dependencies { because("OpenAPI generator depends on older release which isn't compatible with SnakeYAML") } } - implementation libs.openapi.generator + api libs.openapi.generator testImplementation mnTest.micronaut.test.junit5 From a2d465303508d0facdec94515d2ddf38038e9215 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Mon, 26 Jun 2023 16:10:17 +0200 Subject: [PATCH 3/3] Also make client and server public --- .../openapi/generator/JavaMicronautClientCodegen.java | 3 ++- .../openapi/generator/JavaMicronautServerCodegen.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautClientCodegen.java b/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautClientCodegen.java index 9e4737bfc0..e7fabb2ca2 100644 --- a/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautClientCodegen.java +++ b/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautClientCodegen.java @@ -24,7 +24,8 @@ import java.util.Arrays; import java.util.List; -class JavaMicronautClientCodegen extends AbstractMicronautJavaCodegen { +@SuppressWarnings("checkstyle:DesignForExtension") +public class JavaMicronautClientCodegen extends AbstractMicronautJavaCodegen { public static final String OPT_CONFIGURE_AUTH = "configureAuth"; public static final String OPT_CONFIGURE_AUTH_FILTER_PATTERN = "configureAuthFilterPattern"; diff --git a/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautServerCodegen.java b/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautServerCodegen.java index 698e54c3ba..37800c5c98 100644 --- a/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautServerCodegen.java +++ b/openapi-generator/src/main/java/io/micronaut/openapi/generator/JavaMicronautServerCodegen.java @@ -27,7 +27,8 @@ import java.util.Collections; import java.util.List; -class JavaMicronautServerCodegen extends AbstractMicronautJavaCodegen { +@SuppressWarnings("checkstyle:DesignForExtension") +public class JavaMicronautServerCodegen extends AbstractMicronautJavaCodegen { public static final String OPT_CONTROLLER_PACKAGE = "controllerPackage"; public static final String OPT_GENERATE_CONTROLLER_FROM_EXAMPLES = "generateControllerFromExamples";