diff --git a/e2e/src/test/resources/projects/customer-address-postgres-json/pom.xml b/e2e/src/test/resources/projects/customer-address-postgres-json/pom.xml index eba38074..7e2fd502 100644 --- a/e2e/src/test/resources/projects/customer-address-postgres-json/pom.xml +++ b/e2e/src/test/resources/projects/customer-address-postgres-json/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.4 + 3.3.1 io.zenwave360.example @@ -148,7 +148,7 @@ org.openapitools openapi-generator-maven-plugin - 6.6.0 + 7.8.0 @@ -162,9 +162,7 @@ io.zenwave360.example.adapters.web.model DTO true - - ApiUtil.java - + false Double=java.math.BigDecimal @@ -175,7 +173,9 @@ true true true + true false + false diff --git a/e2e/src/test/resources/projects/customer-address-relational/pom.xml b/e2e/src/test/resources/projects/customer-address-relational/pom.xml index 678293e0..5db5954c 100644 --- a/e2e/src/test/resources/projects/customer-address-relational/pom.xml +++ b/e2e/src/test/resources/projects/customer-address-relational/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.4 + 3.3.1 io.zenwave360.example @@ -144,7 +144,7 @@ org.openapitools openapi-generator-maven-plugin - 6.6.0 + 7.8.0 @@ -158,9 +158,7 @@ io.zenwave360.example.adapters.web.model DTO true - - ApiUtil.java - + false Double=java.math.BigDecimal @@ -171,7 +169,9 @@ true true true + true false + false diff --git a/e2e/src/test/resources/projects/online-food-delivery-mongo/pom.xml b/e2e/src/test/resources/projects/online-food-delivery-mongo/pom.xml index 4d396abc..b8e50f63 100644 --- a/e2e/src/test/resources/projects/online-food-delivery-mongo/pom.xml +++ b/e2e/src/test/resources/projects/online-food-delivery-mongo/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.1 + 3.3.1 pom @@ -134,7 +134,7 @@ org.openapitools openapi-generator-maven-plugin - 6.6.0 + 7.8.0 openapi-generator-server @@ -149,9 +149,7 @@ ${basePackage}.adapters.web.model DTO true - - ApiUtil.java - + false Double=java.math.BigDecimal @@ -162,7 +160,9 @@ true true true + true false + false diff --git a/e2e/src/test/resources/projects/simple-domain-packaging/pom.xml b/e2e/src/test/resources/projects/simple-domain-packaging/pom.xml index c47b3384..2ccb37cd 100644 --- a/e2e/src/test/resources/projects/simple-domain-packaging/pom.xml +++ b/e2e/src/test/resources/projects/simple-domain-packaging/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.4 + 3.3.1 io.zenwave360.example @@ -144,7 +144,7 @@ org.openapitools openapi-generator-maven-plugin - 6.6.0 + 7.8.0 @@ -158,9 +158,7 @@ io.zenwave360.example.customer.dtos DTO true - - ApiUtil.java - + false Double=java.math.BigDecimal @@ -171,7 +169,9 @@ true true true + true false + false diff --git a/plugins/openapi-controllers/README.md b/plugins/openapi-controllers/README.md index 012db7fa..d707d0b7 100644 --- a/plugins/openapi-controllers/README.md +++ b/plugins/openapi-controllers/README.md @@ -16,7 +16,62 @@ jbang zw -p io.zenwave360.sdk.plugins.OpenAPIControllersPlugin targetFolder=. ``` -## Options +## Configuring OpenAPI Generator for Compatibility + +Default options for https://openapi-generator.tech/docs/generators/spring/ have changes over time and different versions. Here is a sample configuration that works with this version of ZenWave360 SDK. + +```xml + + org.openapitools + openapi-generator-maven-plugin + 7.8.0 + + + + generate + + generate-sources + + ${project.basedir}/src/main/resources/public/apis/openapi.yml + true + spring + ${openApiApiPackage} + ${openApiModelPackage} + DTO + true + false + + Double=java.math.BigDecimal + + + true + none + false + true + true + true + true + false + false + + + + + +``` + +Also, make sure you set `required: true` for `requestBody` in your OpenAPI definition for post, put, patch... + +```yaml +requestBody: + required: true # this is important + content: + application/json: + schema: + $ref: "#/components/schemas/Customer" +``` + +## Plugin Options | **Option** | **Description** | **Type** | **Default** | **Values** | |-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|---------------------------------------|-----------------------------------| @@ -42,7 +97,6 @@ jbang zw -p io.zenwave360.sdk.plugins.OpenAPIControllersPlugin | `haltOnFailFormatting` | Halt on formatting errors | boolean | true | | | `continueOnZdlError` | Continue even when ZDL contains fatal errors | boolean | true | | - ## Getting Help ```shell