Skip to content

Commit c8528cc

Browse files
committed
update doc, tests
1 parent 2c682e6 commit c8528cc

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

docs/customization.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,13 @@ Example:
644644
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer NORMALIZER_CLASS=org.openapitools.codegen.OpenAPINormalizerTest$RemoveRequiredNormalizer
645645
```
646646
647+
- `LOOSE_NULL_DEFINITIONS`: When set to true, allow more schema definitions to be the same as `null` in OpenAPI 3.1 spec by setting ModelUtils.looseNullDefinitions to true.
648+
649+
Example:
650+
```
651+
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/bugs/issue_anyof_bare_nullable_object.yaml -o /tmp/java-okhttp/ --openapi-normalizer LOOSE_NULL_DEFINITIONS=true
652+
```
653+
647654
- `REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT`: When set to true, remove the "properties" of a schema with type other than "object".
648655
649656
Example:

modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ public Schema normalizeSchema(Schema schema, Set<Schema> visitedSchemas) {
18341834
}
18351835

18361836
@Test
1837-
public void testREPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING() {
1837+
public void testReplaceOneOfByDiscriminatorMapping() {
18381838
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/oneOf_issue_23527.yaml");
18391839

18401840
Map<String, String> inputRules = Map.of("REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING", "true");
@@ -1847,7 +1847,7 @@ public void testREPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING() {
18471847
}
18481848

18491849
@Test
1850-
public void issue_14769() {
1850+
public void testIssue14769() {
18511851
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/oneOf_issue_14769.yaml");
18521852
Map<String, String> inputRules = Map.of("REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING", "true");
18531853
OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, inputRules);
@@ -1864,7 +1864,7 @@ public void issue_14769() {
18641864
}
18651865

18661866
@Test
1867-
public void oneOf_issue_23276() {
1867+
public void oneOfIssue23276() {
18681868
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/oneOf_issue_23276.yaml");
18691869
Map<String, String> inputRules = Map.of("REPLACE_ONE_OF_BY_DISCRIMINATOR_MAPPING", "true");
18701870
OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, inputRules);

0 commit comments

Comments
 (0)