Skip to content

Commit 7f22568

Browse files
committed
minor fix in default codegen
1 parent 2f85c53 commit 7f22568

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ public void execute() throws MojoExecutionException {
865865
}
866866

867867
// Apply Parameter Name Mappings
868-
if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("paramter-name-mappings"))) {
868+
if (parameterNameMappings != null && (configOptions == null || !configOptions.containsKey("parameter-name-mappings"))) {
869869
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
870870
}
871871

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,9 +1942,9 @@ public String toInstantiationType(Schema schema) {
19421942
if (ModelUtils.isMapSchema(schema)) {
19431943
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
19441944
String inner = getSchemaType(additionalProperties);
1945-
String mapInstantion = instantiationTypes.get("map");
1946-
if (mapInstantion != null) {
1947-
return mapInstantion + "<String, " + inner + ">";
1945+
String mapInstantiation = instantiationTypes.get("map");
1946+
if (mapInstantiation != null) {
1947+
return mapInstantiation + "<String, " + inner + ">";
19481948
}
19491949
return inner;
19501950
} else if (ModelUtils.isArraySchema(schema)) {
@@ -2217,7 +2217,7 @@ public String toDefaultValueWithParam(String name, Schema schema) {
22172217
* @return string presentation of the default value of the property
22182218
*/
22192219
public String toDefaultValue(CodegenProperty codegenProperty, Schema schema) {
2220-
// use toDefaultValue(schema) if generator has not overriden this method
2220+
// use toDefaultValue(schema) if generator has not overridden this method
22212221
return toDefaultValue(schema);
22222222
}
22232223

@@ -3149,7 +3149,7 @@ protected void setAddProps(Schema schema, IJsonSchemaValidationProperties proper
31493149
// if we are trying to set additionalProperties on an empty schema stop recursing
31503150
return;
31513151
}
3152-
// Note: This flag is set to true if additioanl properties
3152+
// Note: This flag is set to true if additional properties
31533153
// is set (any type, free form object, boolean true, string, etc).
31543154
// The variable name may be renamed later to avoid confusion.
31553155
boolean additionalPropertiesIsAnyType = false;
@@ -3989,7 +3989,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo
39893989
property._enum = new ArrayList<>();
39903990
for (Object i : _enum) {
39913991
// raw null values in enums are unions for nullable
3992-
// atttributes, not actual enum values, so we remove them here
3992+
// attributes, not actual enum values, so we remove them here
39933993
if (i == null) {
39943994
property.isNullable = true;
39953995
continue;
@@ -4001,7 +4001,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo
40014001

40024002
Map<String, Object> allowableValues = new HashMap<>();
40034003
allowableValues.put("values", _enum);
4004-
if (allowableValues.size() > 0) {
4004+
if (!allowableValues.isEmpty()) {
40054005
property.allowableValues = allowableValues;
40064006
}
40074007
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public String apiFileFolder() {
335335
}
336336

337337
/**
338-
* Location of created model files (it can be overriden using --additional-properties in openapi-generator-cli
338+
* Location of created model files (it can be overridden using --additional-properties in openapi-generator-cli
339339
*/
340340
@Override
341341
public String modelFileFolder() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public void processOpts() {
320320
dateLibrary = "legacy";
321321
}
322322
super.processOpts();
323-
// default jackson unless overriden by setSerializationLibrary
323+
// default jackson unless overridden by setSerializationLibrary
324324
this.jackson = !additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY) || SERIALIZATION_LIBRARY_JACKSON.equals(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY));
325325

326326
convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup);

modules/openapi-generator/src/test/resources/3_0/jetbrains/github.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94117,7 +94117,7 @@
9411794117
"nullable": true
9411894118
},
9411994119
"idle_timeout_notice": {
94120-
"description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy",
94120+
"description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy",
9412194121
"type": "string",
9412294122
"nullable": true
9412394123
},
@@ -116606,7 +116606,7 @@
116606116606
"nullable": true
116607116607
},
116608116608
"idle_timeout_notice": {
116609-
"description": "Text to show user when codespace idle timeout minutes has been overriden by an organization policy",
116609+
"description": "Text to show user when codespace idle timeout minutes has been overridden by an organization policy",
116610116610
"type": "string",
116611116611
"nullable": true
116612116612
},

0 commit comments

Comments
 (0)