Skip to content

Commit c22998c

Browse files
committed
change default value of disallowAdditionalPropertiesIfNotPresent
1 parent 3c664d1 commit c22998c

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
@@ -1792,15 +1792,15 @@ public DefaultCodegen() {
17921792
// option to change how we process + set the data in the 'additionalProperties' keyword.
17931793
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
17941794
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
1795-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
1795+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
17961796
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
17971797
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
17981798
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
17991799
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
18001800
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
18011801
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
18021802
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
1803-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
1803+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
18041804

18051805
CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean(
18061806
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
@@ -252,15 +252,15 @@ public CSharpClientCodegen() {
252252

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

265265
ImmutableMap.Builder<String, String> frameworkBuilder = new ImmutableMap.Builder<>();
266266
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
@@ -161,15 +161,15 @@ public PythonClientCodegen() {
161161
// option to change how we process + set the data in the 'additionalProperties' keyword.
162162
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
163163
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
164-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
164+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
165165
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
166166
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
167167
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
168168
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
169169
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
170170
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
171171
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
172-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
172+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
173173
}
174174

175175
@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)