diff --git a/build.gradle b/build.gradle index 0368b62f..04eb054c 100644 --- a/build.gradle +++ b/build.gradle @@ -180,7 +180,7 @@ dependencies { implementation 'com.google.googlejavaformat:google-java-format:1.18.1' // implementation 'io.openapiprocessor:' - implementation 'io.openapiprocessor:openapi-processor-spring:2023.4' +// implementation 'io.openapiprocessor:openapi-processor-spring:2023.4' api 'commons-io:commons-io:2.12.0' api gradleApi() diff --git a/src/main/java/io/swagger/codegen/v3/generators/WebFluxCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/WebFluxCodegen.java index 674a801f..60b763a6 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/WebFluxCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/WebFluxCodegen.java @@ -18,7 +18,7 @@ public WebFluxCodegen() { @Override public String getDefaultTemplateDir() { - return "entry-point/rest-with-swagger"; + return "entry-point/rest-from-swagger"; } @Override @@ -47,6 +47,7 @@ public void processOpts() { apiTestTemplateFiles.clear(); // TODO: implement it apiDocTemplateFiles.clear(); apiTemplateFiles.clear(); + importMapping.put("OffsetDateTime", "java.time.OffsetDateTime"); if (((Boolean) additionalProperties.getOrDefault("router", false))) { apiTemplateFiles.put("apiHandler.mustache", "Handler.java"); apiTemplateFiles.put("apiRouter.mustache", "Router.java"); diff --git a/src/main/resources/entry-point/rest-with-swagger/allowableValues.mustache b/src/main/resources/entry-point/rest-from-swagger/allowableValues.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/allowableValues.mustache rename to src/main/resources/entry-point/rest-from-swagger/allowableValues.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/apiController.mustache b/src/main/resources/entry-point/rest-from-swagger/apiController.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/apiController.mustache rename to src/main/resources/entry-point/rest-from-swagger/apiController.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/apiExceptionHandler.mustache b/src/main/resources/entry-point/rest-from-swagger/apiExceptionHandler.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/apiExceptionHandler.mustache rename to src/main/resources/entry-point/rest-from-swagger/apiExceptionHandler.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/apiHandler.mustache b/src/main/resources/entry-point/rest-from-swagger/apiHandler.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/apiHandler.mustache rename to src/main/resources/entry-point/rest-from-swagger/apiHandler.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/apiRouter.mustache b/src/main/resources/entry-point/rest-from-swagger/apiRouter.mustache similarity index 95% rename from src/main/resources/entry-point/rest-with-swagger/apiRouter.mustache rename to src/main/resources/entry-point/rest-from-swagger/apiRouter.mustache index 281df52b..2828d967 100644 --- a/src/main/resources/entry-point/rest-with-swagger/apiRouter.mustache +++ b/src/main/resources/entry-point/rest-from-swagger/apiRouter.mustache @@ -52,7 +52,7 @@ public class {{classname}}Router { {{/lombok}} @Bean - public RouterFunction routerFunction({{classname}}Handler handler) { + public RouterFunction routerFunction{{classname}}({{classname}}Handler handler) { {{#operation}} {{#@first}} {{#contents}} diff --git a/src/main/resources/entry-point/rest-with-swagger/beanValidation.mustache b/src/main/resources/entry-point/rest-from-swagger/beanValidation.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/beanValidation.mustache rename to src/main/resources/entry-point/rest-from-swagger/beanValidation.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/beanValidationCore.mustache b/src/main/resources/entry-point/rest-from-swagger/beanValidationCore.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/beanValidationCore.mustache rename to src/main/resources/entry-point/rest-from-swagger/beanValidationCore.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/beanValidationPathParams.mustache b/src/main/resources/entry-point/rest-from-swagger/beanValidationPathParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/beanValidationPathParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/beanValidationPathParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/beanValidationQueryParams.mustache b/src/main/resources/entry-point/rest-from-swagger/beanValidationQueryParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/beanValidationQueryParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/beanValidationQueryParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/bodyParams.mustache b/src/main/resources/entry-point/rest-from-swagger/bodyParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/bodyParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/bodyParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/cookieParams.mustache b/src/main/resources/entry-point/rest-from-swagger/cookieParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/cookieParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/cookieParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/enumClass.mustache b/src/main/resources/entry-point/rest-from-swagger/enumClass.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/enumClass.mustache rename to src/main/resources/entry-point/rest-from-swagger/enumClass.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/exampleReturnTypes.mustache b/src/main/resources/entry-point/rest-from-swagger/exampleReturnTypes.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/exampleReturnTypes.mustache rename to src/main/resources/entry-point/rest-from-swagger/exampleReturnTypes.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/formParams.mustache b/src/main/resources/entry-point/rest-from-swagger/formParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/formParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/formParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/headerParams.mustache b/src/main/resources/entry-point/rest-from-swagger/headerParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/headerParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/headerParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/model.mustache b/src/main/resources/entry-point/rest-from-swagger/model.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/model.mustache rename to src/main/resources/entry-point/rest-from-swagger/model.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/optionalDataType.mustache b/src/main/resources/entry-point/rest-from-swagger/optionalDataType.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/optionalDataType.mustache rename to src/main/resources/entry-point/rest-from-swagger/optionalDataType.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/pathParams.mustache b/src/main/resources/entry-point/rest-from-swagger/pathParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/pathParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/pathParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/pojo.mustache b/src/main/resources/entry-point/rest-from-swagger/pojo.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/pojo.mustache rename to src/main/resources/entry-point/rest-from-swagger/pojo.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/queryParams.mustache b/src/main/resources/entry-point/rest-from-swagger/queryParams.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/queryParams.mustache rename to src/main/resources/entry-point/rest-from-swagger/queryParams.mustache diff --git a/src/main/resources/entry-point/rest-with-swagger/returnTypes.mustache b/src/main/resources/entry-point/rest-from-swagger/returnTypes.mustache similarity index 100% rename from src/main/resources/entry-point/rest-with-swagger/returnTypes.mustache rename to src/main/resources/entry-point/rest-from-swagger/returnTypes.mustache