Skip to content

Commit 0612c0d

Browse files
committed
change default value of disallowAdditionalPropertiesIfNotPresent
1 parent 8087f2b commit 0612c0d

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
408408

409409
public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "disallowAdditionalPropertiesIfNotPresent";
410410
public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC =
411-
"If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " +
412-
"If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.";
411+
"If false (default), the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. " +
412+
"If true, keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.";
413413

414414
public static final String UNSUPPORTED_V310_SPEC_MSG =
415415
"OpenAPI 3.1 support is still in beta. To report an issue related to 3.1 spec, please kindly open an issue in the Github repo: https://github.com/openAPITools/openapi-generator.";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,15 +1804,15 @@ public DefaultCodegen() {
18041804
// option to change how we process + set the data in the 'additionalProperties' keyword.
18051805
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
18061806
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
1807-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
1807+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
18081808
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
18091809
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
18101810
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
18111811
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
18121812
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
18131813
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
18141814
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
1815-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
1815+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
18161816

18171817
CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean(
18181818
CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ public CSharpClientCodegen() {
247247

248248
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
249249
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
250-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
250+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
251251
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
252252
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
253253
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
254254
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
255255
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
256256
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
257257
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
258-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
258+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
259259

260260
ImmutableMap.Builder<String, String> frameworkBuilder = new ImmutableMap.Builder<>();
261261
for (FrameworkStrategy frameworkStrategy : frameworkStrategies) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ public CSharpReducedClientCodegen() {
187187

188188
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
189189
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
190-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
190+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
191191
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
192192
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
193193
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
194194
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
195195
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
196196
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
197197
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
198-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
198+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
199199

200200
ImmutableMap.Builder<String, String> frameworkBuilder = new ImmutableMap.Builder<>();
201201
for (FrameworkStrategy frameworkStrategy : frameworkStrategies) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ public GoClientCodegen() {
140140
// option to change how we process + set the data in the 'additionalProperties' keyword.
141141
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
142142
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
143-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
143+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
144144
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
145145
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
146146
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
147147
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
148148
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
149149
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
150150
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
151-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
151+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
152152
cliOptions.add(CliOption.newBoolean(WITH_GO_MOD, "Generate go.mod and go.sum", true));
153153
cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_MARSHAL_JSON, CodegenConstants.GENERATE_MARSHAL_JSON_DESC, true));
154154
cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_UNMARSHAL_JSON, CodegenConstants.GENERATE_UNMARSHAL_JSON_DESC, true));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,15 @@ public PowerShellClientCodegen() {
559559
// option to change how we process + set the data in the 'additionalProperties' keyword.
560560
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
561561
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
562-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
562+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
563563
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
564564
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
565565
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
566566
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
567567
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
568568
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
569569
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
570-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
570+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
571571

572572
// default value in the template
573573
additionalProperties.put("powershellVersion", "6.2"); // minimal PS version

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ public PythonClientCodegen() {
163163
// option to change how we process + set the data in the 'additionalProperties' keyword.
164164
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
165165
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
166-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
166+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
167167
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
168168
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
169169
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
170170
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
171171
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
172172
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
173173
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
174-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
174+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
175175
}
176176

177177
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ public PythonPydanticV1ClientCodegen() {
170170
// option to change how we process + set the data in the 'additionalProperties' keyword.
171171
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
172172
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
173-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
173+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
174174
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
175175
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
176176
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
177177
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
178178
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
179179
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
180180
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
181-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
181+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
182182
}
183183

184184
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ public RClientCodegen() {
225225
// option to change how we process + set the data in the 'additionalProperties' keyword.
226226
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
227227
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
228-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
228+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
229229
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
230230
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
231231
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
232232
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
233233
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
234234
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
235235
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
236-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
236+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
237237

238238
}
239239

0 commit comments

Comments
 (0)