Skip to content

Commit 7275888

Browse files
authored
update normalizer doc with correct path to spec (#23636)
* update normalizer doc with correct path to spec * use java instead of spring
1 parent 0b1ac88 commit 7275888

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

docs/customization.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,30 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
655655
656656
Example:
657657
```
658-
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
658+
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
659+
```
660+
661+
Here is what the change in the spec looks like:
662+
663+
```diff
664+
diff --git a/api/openapi.yaml b/api/openapi.yaml
665+
index 6f27abd..146c61c 100644
666+
--- a/api/openapi.yaml
667+
+++ b/api/openapi.yaml
668+
@@ -9,10 +9,10 @@ components:
669+
schemas:
670+
GeoJsonObject:
671+
discriminator:
672+
+ mapping:
673+
+ MultiPolygon: "#/components/schemas/Multi-Polygon"
674+
+ Polygon: "#/components/schemas/Polygon"
675+
propertyName: type
676+
- oneOf:
677+
- - $ref: "#/components/schemas/Polygon"
678+
- - $ref: "#/components/schemas/Multi-Polygon"
679+
properties:
680+
type:
681+
type: string
659682
```
660683

661684
- `FILTER`

0 commit comments

Comments
 (0)