Skip to content

Commit 4256f49

Browse files
committed
change default value of disallowAdditionalPropertiesIfNotPresent
1 parent 554e10d commit 4256f49

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
@@ -1808,15 +1808,15 @@ public DefaultCodegen() {
18081808
// option to change how we process + set the data in the 'additionalProperties' keyword.
18091809
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
18101810
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
1811-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
1811+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
18121812
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
18131813
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
18141814
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
18151815
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
18161816
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
18171817
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
18181818
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
1819-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
1819+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
18201820

18211821
CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean(
18221822
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
@@ -248,15 +248,15 @@ public CSharpClientCodegen() {
248248

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

261261
ImmutableMap.Builder<String, String> frameworkBuilder = new ImmutableMap.Builder<>();
262262
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
@@ -188,15 +188,15 @@ public CSharpReducedClientCodegen() {
188188

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

201201
ImmutableMap.Builder<String, String> frameworkBuilder = new ImmutableMap.Builder<>();
202202
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
@@ -141,15 +141,15 @@ public GoClientCodegen() {
141141
// option to change how we process + set the data in the 'additionalProperties' keyword.
142142
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
143143
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
144-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
144+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
145145
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
146146
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
147147
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
148148
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
149149
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
150150
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
151151
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
152-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
152+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
153153
cliOptions.add(CliOption.newBoolean(WITH_GO_MOD, "Generate go.mod and go.sum", true));
154154
cliOptions.add(CliOption.newBoolean(CodegenConstants.GENERATE_MARSHAL_JSON, CodegenConstants.GENERATE_MARSHAL_JSON_DESC, true));
155155
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
@@ -166,15 +166,15 @@ public PythonClientCodegen() {
166166
// option to change how we process + set the data in the 'additionalProperties' keyword.
167167
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
168168
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
169-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
169+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
170170
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
171171
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
172172
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
173173
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
174174
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
175175
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
176176
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
177-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
177+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
178178
}
179179

180180
@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
@@ -171,15 +171,15 @@ public PythonPydanticV1ClientCodegen() {
171171
// option to change how we process + set the data in the 'additionalProperties' keyword.
172172
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
173173
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
174-
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
174+
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
175175
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
176176
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
177177
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
178178
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
179179
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.");
180180
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
181181
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
182-
this.setDisallowAdditionalPropertiesIfNotPresent(true);
182+
this.setDisallowAdditionalPropertiesIfNotPresent(false);
183183
}
184184

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