Skip to content

Commit 3119eca

Browse files
authored
Merge pull request #2 from martin-mfg/pr_20919_improvements
small improvements
2 parents e7b3c16 + df46ce5 commit 3119eca

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

docs/generators/java-camel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
7272
|licenseName|The name of the license| |Unlicense|
7373
|licenseUrl|The URL of the license| |http://unlicense.org|
7474
|modelPackage|package for generated models| |org.openapitools.model|
75-
|oneOfInterfacesDeduction|whether to use deduction for generated oneOf interfaces| |false|
7675
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
7776
|optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true|
7877
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
@@ -99,6 +98,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
9998
|title|server title name or client service name| |OpenAPI Spring|
10099
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
101100
|useBeanValidation|Use BeanValidation API annotations| |true|
101+
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
102102
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
103103
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
104104
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|

docs/generators/spring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6565
|licenseName|The name of the license| |Unlicense|
6666
|licenseUrl|The URL of the license| |http://unlicense.org|
6767
|modelPackage|package for generated models| |org.openapitools.model|
68-
|oneOfInterfacesDeduction|whether to use deduction for generated oneOf interfaces| |false|
6968
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
7069
|optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true|
7170
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
@@ -92,6 +91,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
9291
|title|server title name or client service name| |OpenAPI Spring|
9392
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
9493
|useBeanValidation|Use BeanValidation API annotations| |true|
94+
|useDeductionForOneOfInterfaces|whether to use deduction for generated oneOf interfaces| |false|
9595
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
9696
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
9797
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public class SpringCodegen extends AbstractJavaCodegen
9696
public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface";
9797
public static final String USE_SEALED = "useSealed";
9898
public static final String OPTIONAL_ACCEPT_NULLABLE = "optionalAcceptNullable";
99-
public static final String USE_DEDUCTION_FOR_ONE_OF_INTERFACES = "oneOfInterfacesDeduction";
99+
public static final String USE_DEDUCTION_FOR_ONE_OF_INTERFACES = "useDeductionForOneOfInterfaces";
100+
100101
@Getter
101102
public enum RequestMappingMode {
102103
api_interface("Generate the @RequestMapping annotation on the generated Api Interface."),
@@ -426,6 +427,7 @@ public void processOpts() {
426427
convertPropertyToBooleanAndWriteBack(UNHANDLED_EXCEPTION_HANDLING, this::setUnhandledException);
427428
convertPropertyToBooleanAndWriteBack(USE_RESPONSE_ENTITY, this::setUseResponseEntity);
428429
convertPropertyToBooleanAndWriteBack(OPTIONAL_ACCEPT_NULLABLE, this::setOptionalAcceptNullable);
430+
convertPropertyToBooleanAndWriteBack(USE_DEDUCTION_FOR_ONE_OF_INTERFACES, this::setUseDeductionForOneOfInterfaces);
429431

430432
additionalProperties.put("springHttpStatus", new SpringHttpStatusLambda());
431433

0 commit comments

Comments
 (0)