From 5708c5549c179a13790503b7f8433e78749c9951 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 28 Apr 2026 12:09:21 +0800 Subject: [PATCH 1/2] update normalizer doc with correct path to spec --- docs/customization.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/customization.md b/docs/customization.md index 7ba435cb8d54..fdf6cd9aed5c 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -655,7 +655,30 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat Example: ``` -java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g spring -i modules/openapi-generator/src/test/resources/3_0/spring/issue_23527.yaml -o /tmp/java-spring/ --openapi-normalizer REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING=true +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g spring -i modules/openapi-generator/src/test/resources/3_0/oneOf_issue_23527.yaml -o /tmp/java-spring/ --openapi-normalizer REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING=true +``` + +Here is what the change in the spec looks like: + +```diff +diff --git a/api/openapi.yaml b/api/openapi.yaml +index 6f27abd..146c61c 100644 +--- a/api/openapi.yaml ++++ b/api/openapi.yaml +@@ -9,10 +9,10 @@ components: + schemas: + GeoJsonObject: + discriminator: ++ mapping: ++ MultiPolygon: "#/components/schemas/Multi-Polygon" ++ Polygon: "#/components/schemas/Polygon" + propertyName: type +- oneOf: +- - $ref: "#/components/schemas/Polygon" +- - $ref: "#/components/schemas/Multi-Polygon" + properties: + type: + type: string ``` - `FILTER` From d7ebcfe021c970b612bd7783b9beacd39b7f66a1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 28 Apr 2026 12:11:38 +0800 Subject: [PATCH 2/2] use java instead of spring --- docs/customization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/customization.md b/docs/customization.md index fdf6cd9aed5c..c529eb4bc5f9 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -655,7 +655,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat Example: ``` -java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g spring -i modules/openapi-generator/src/test/resources/3_0/oneOf_issue_23527.yaml -o /tmp/java-spring/ --openapi-normalizer REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING=true +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/oneOf_issue_23527.yaml -o /tmp/java/ --openapi-normalizer REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING=true ``` Here is what the change in the spec looks like: