mirror of
				https://github.com/OpenAPITools/openapi-generator.git
				synced 2025-11-04 10:43:44 +00:00 
			
		
		
		
	[cleanup] erefactor/AutoRefactor - Log parameters rather than log message (#9665)
AutoRefactor cleanup 'LogParametersRatherThanLogMessage' applied by erefactor: Replaces a string concatenation as parameter of a logger method by a string template followed by objects. For AutoRefactor see https://github.com/JnRouvignac/AutoRefactor For erefactor see https://github.com/cal101/erefactor
This commit is contained in:
		
							parent
							
								
									9099b43cd8
								
							
						
					
					
						commit
						2d5199f80f
					
				@ -497,7 +497,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
 | 
			
		||||
                } else if ("pipes".equals(p.collectionFormat)) {
 | 
			
		||||
                    p.vendorExtensions.put("x-codegen-collection-pipes", true);
 | 
			
		||||
                } else {
 | 
			
		||||
                    LOGGER.warn("Unsupported collection format in Bash generator: " + p.collectionFormat);
 | 
			
		||||
                    LOGGER.warn("Unsupported collection format in Bash generator: {}", p.collectionFormat);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@ -778,7 +778,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
 | 
			
		||||
        } else if ("array".equalsIgnoreCase(type) || "map".equalsIgnoreCase(type)) {
 | 
			
		||||
            // skip map/array as it will be handled below
 | 
			
		||||
        } else {
 | 
			
		||||
            LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
 | 
			
		||||
            LOGGER.warn("Type {} not handled properly in setParameterExampleValue", type);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (example == null) {
 | 
			
		||||
@ -802,20 +802,20 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
 | 
			
		||||
        // rename to empty_method_name_1 (e.g.) if method name is empty
 | 
			
		||||
        if (StringUtils.isEmpty(operationId)) {
 | 
			
		||||
            operationId = camelize("empty_method_name_" + emptyMethodNameCounter++, true);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to " + operationId);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to {}", operationId);
 | 
			
		||||
            return operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = underscore("call" + camelize(operationId));
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -519,7 +519,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
        } else if (ModelUtils.isObjectSchema(schema)) {
 | 
			
		||||
            return null; // models are managed at moustache level
 | 
			
		||||
        } else {
 | 
			
		||||
            LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue");
 | 
			
		||||
            LOGGER.warn("Type {} not handled properly in toExampleValue", schema.getType());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ModelUtils.isStringSchema(schema)) {
 | 
			
		||||
@ -593,13 +593,14 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            String modelName = camelize("Model" + name);
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // model name starts with number
 | 
			
		||||
        if (name.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name));
 | 
			
		||||
            LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name,
 | 
			
		||||
                    camelize("model_" + name));
 | 
			
		||||
            name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -719,21 +720,21 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
        // rename to empty_method_name_1 (e.g.) if method name is empty
 | 
			
		||||
        if (StringUtils.isEmpty(operationId)) {
 | 
			
		||||
            operationId = camelize("empty_method_name_" + emptyMethodNameCounter++);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to " + operationId);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to {}", operationId);
 | 
			
		||||
            return operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = camelize(sanitizeName("call_" + operationId), true);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            String newOperationId = camelize(sanitizeName("call_" + operationId), true);
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -889,7 +890,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
                if (exitValue != 0) {
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
 | 
			
		||||
                } else {
 | 
			
		||||
                    LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                    LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
 | 
			
		||||
@ -311,7 +311,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
            LOGGER.warn(".NET Standard 1.3 support has been DEPRECATED in this generator. Please use `csharp-netcore` generator instead.");
 | 
			
		||||
            additionalProperties.put(MCS_NET_VERSION_KEY, "4.6-api");
 | 
			
		||||
            if (additionalProperties.containsKey("supportsUWP")) {
 | 
			
		||||
                LOGGER.warn(".NET " + NETSTANDARD + " generator does not support UWP.");
 | 
			
		||||
                LOGGER.warn(".NET {} generator does not support UWP.", NETSTANDARD);
 | 
			
		||||
                additionalProperties.remove("supportsUWP");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -332,7 +332,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
        } else if (NET40.equals(this.targetFramework)) {
 | 
			
		||||
            additionalProperties.put(MCS_NET_VERSION_KEY, "4");
 | 
			
		||||
            if (additionalProperties.containsKey(CodegenConstants.SUPPORTS_ASYNC)) {
 | 
			
		||||
                LOGGER.warn(".NET " + NET40 + " generator does not support async.");
 | 
			
		||||
                LOGGER.warn(".NET {} generator does not support async.", NET40);
 | 
			
		||||
                additionalProperties.remove(CodegenConstants.SUPPORTS_ASYNC);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -350,13 +350,13 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
 | 
			
		||||
        if (additionalProperties.containsKey(CodegenConstants.GENERATE_PROPERTY_CHANGED)) {
 | 
			
		||||
            if (NET35.equals(targetFramework)) {
 | 
			
		||||
                LOGGER.warn(CodegenConstants.GENERATE_PROPERTY_CHANGED + " is only supported by generated code for .NET 4+.");
 | 
			
		||||
                LOGGER.warn("{} is only supported by generated code for .NET 4+.", CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
                additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
            } else if (NETSTANDARD.equals(targetFramework)) {
 | 
			
		||||
                LOGGER.warn(CodegenConstants.GENERATE_PROPERTY_CHANGED + " is not supported in .NET Standard generated code.");
 | 
			
		||||
                LOGGER.warn("{} is not supported in .NET Standard generated code.", CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
                additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
            } else if (Boolean.TRUE.equals(netCoreProjectFileFlag)) {
 | 
			
		||||
                LOGGER.warn(CodegenConstants.GENERATE_PROPERTY_CHANGED + " is not supported in .NET Core csproj project format.");
 | 
			
		||||
                LOGGER.warn("{} is not supported in .NET Core csproj project format.", CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
                additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
            } else {
 | 
			
		||||
                setGeneratePropertyChanged(convertPropertyToBooleanAndWriteBack(CodegenConstants.GENERATE_PROPERTY_CHANGED));
 | 
			
		||||
@ -714,7 +714,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
 | 
			
		||||
    public void setTargetFramework(String dotnetFramework) {
 | 
			
		||||
        if (!frameworks.containsKey(dotnetFramework)) {
 | 
			
		||||
            LOGGER.warn("Invalid .NET framework version, defaulting to " + this.targetFramework);
 | 
			
		||||
            LOGGER.warn("Invalid .NET framework version, defaulting to {}", this.targetFramework);
 | 
			
		||||
        } else {
 | 
			
		||||
            this.targetFramework = dotnetFramework;
 | 
			
		||||
        }
 | 
			
		||||
@ -758,7 +758,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework " + this.targetFramework);
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework {}", this.targetFramework);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) {
 | 
			
		||||
 | 
			
		||||
@ -268,7 +268,7 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void postProcessParentModels(final Map<String, Object> models) {
 | 
			
		||||
        LOGGER.debug("Processing parents:  " + parentModels);
 | 
			
		||||
        LOGGER.debug("Processing parents:  {}", parentModels);
 | 
			
		||||
        for (final String parent : parentModels) {
 | 
			
		||||
            final CodegenModel parentModel = ModelUtils.getModelByName(parent, models);
 | 
			
		||||
            if (parentModel != null) {
 | 
			
		||||
 | 
			
		||||
@ -639,7 +639,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (additionalProperties.containsKey(CodegenConstants.GENERATE_PROPERTY_CHANGED)) {
 | 
			
		||||
            LOGGER.warn(CodegenConstants.GENERATE_PROPERTY_CHANGED + " is not supported in the .NET Standard generator.");
 | 
			
		||||
            LOGGER.warn("{} is not supported in the .NET Standard generator.", CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
            additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -789,7 +789,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
        } else {
 | 
			
		||||
            this.targetFramework = dotnetFramework;
 | 
			
		||||
        }
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework " + this.targetFramework);
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework {}", this.targetFramework);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setTargetFramework(List<FrameworkStrategy> strategies) {
 | 
			
		||||
@ -804,7 +804,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
        }
 | 
			
		||||
        this.targetFramework = strategies.stream().map(p -> p.name)
 | 
			
		||||
                .collect(Collectors.joining(";"));
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework " + this.targetFramework);
 | 
			
		||||
        LOGGER.info("Generating code for .NET Framework {}", this.targetFramework);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setTestTargetFramework(String testTargetFramework) {
 | 
			
		||||
@ -1026,7 +1026,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
 | 
			
		||||
 | 
			
		||||
            properties.put(NET_STANDARD, this.isNetStandard);
 | 
			
		||||
            if (properties.containsKey(SUPPORTS_UWP)) {
 | 
			
		||||
                LOGGER.warn(".NET " + this.name + " generator does not support the UWP option. Use the csharp generator instead.");
 | 
			
		||||
                LOGGER.warn(".NET {} generator does not support the UWP option. Use the csharp generator instead.",
 | 
			
		||||
                        this.name);
 | 
			
		||||
                properties.remove(SUPPORTS_UWP);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -363,13 +363,14 @@ public class CrystalClientCodegen extends DefaultCodegen {
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(modelName)) {
 | 
			
		||||
            modelName = camelize("Model" + modelName);
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // model name starts with number
 | 
			
		||||
        if (modelName.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(modelName + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + modelName));
 | 
			
		||||
            LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", modelName,
 | 
			
		||||
                    camelize("model_" + modelName));
 | 
			
		||||
            modelName = "model_" + modelName; // e.g. 200Response => Model200Response (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -482,20 +483,20 @@ public class CrystalClientCodegen extends DefaultCodegen {
 | 
			
		||||
        // rename to empty_method_name_1 (e.g.) if method name is empty
 | 
			
		||||
        if (StringUtils.isEmpty(operationId)) {
 | 
			
		||||
            operationId = underscore("empty_method_name_" + emptyMethodNameCounter++);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to " + operationId);
 | 
			
		||||
            LOGGER.warn("Empty method name (operationId) found. Renamed to {}", operationId);
 | 
			
		||||
            return operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = underscore("call_" + operationId);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -881,7 +882,7 @@ public class CrystalClientCodegen extends DefaultCodegen {
 | 
			
		||||
                    }
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb.toString());
 | 
			
		||||
                } else {
 | 
			
		||||
                    LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                    LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
 | 
			
		||||
@ -449,13 +449,14 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + ("model_" + name));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, "model_" + name);
 | 
			
		||||
            name = "model_" + name; // e.g. return => ModelReturn (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // model name starts with number
 | 
			
		||||
        if (name.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + ("model_" + name));
 | 
			
		||||
            LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name,
 | 
			
		||||
                    "model_" + name);
 | 
			
		||||
            name = "model_" + name; // e.g. 200Response => Model200Response (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -471,13 +472,13 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            return underscore(sanitizeName("call_" + operationId));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -602,7 +603,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
                return code;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            LOGGER.warn("Unknown HTTP status code: " + this.code);
 | 
			
		||||
            LOGGER.warn("Unknown HTTP status code: {}", this.code);
 | 
			
		||||
            return "\"" + code + "\"";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -188,7 +188,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -300,7 +300,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
    public String toOperationId(String operationId) {
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. if
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)).replaceAll("\\.", "_"));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)).replaceAll("\\.", "_"));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -359,7 +359,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
    public String toOperationId(String operationId) {
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)).replaceAll("\\.", "_"));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)).replaceAll("\\.", "_"));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -256,7 +256,7 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
    public String toOperationId(String operationId) {
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId)));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -327,7 +327,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, camelize("model_" + name));
 | 
			
		||||
            name = "model_" + name; // e.g. return => ModelReturn (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -377,7 +377,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig
 | 
			
		||||
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId)));
 | 
			
		||||
            operationId = "call_" + operationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -262,7 +262,7 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
 | 
			
		||||
            String original = operation.path;
 | 
			
		||||
            operation.path = operation.path.replace("?", "/");
 | 
			
		||||
            if (!original.equals(operation.path)) {
 | 
			
		||||
                LOGGER.warn("Normalized " + original + " to " + operation.path + ". Please verify generated source.");
 | 
			
		||||
                LOGGER.warn("Normalized {} to {}. Please verify generated source.", original, operation.path);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -655,8 +655,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
 | 
			
		||||
            Schema additionalProperties2 = getAdditionalProperties(p);
 | 
			
		||||
            String type = additionalProperties2.getType();
 | 
			
		||||
            if (null == type) {
 | 
			
		||||
                LOGGER.error("No Type defined for Additional Schema " + additionalProperties2 + "\n" //
 | 
			
		||||
                        + "\tIn Schema: " + p);
 | 
			
		||||
                LOGGER.error("No Type defined for Additional Schema {}\n\tIn Schema: {}", additionalProperties2, p);
 | 
			
		||||
            }
 | 
			
		||||
            String inner = getSchemaType(additionalProperties2);
 | 
			
		||||
            return "(Map.Map Text " + inner + ")";
 | 
			
		||||
@ -693,7 +692,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
 | 
			
		||||
            counter++;
 | 
			
		||||
        }
 | 
			
		||||
        if (!op.operationId.equals(uniqueName)) {
 | 
			
		||||
            LOGGER.warn("generated unique operationId `" + uniqueName + "`");
 | 
			
		||||
            LOGGER.warn("generated unique operationId `{}`", uniqueName);
 | 
			
		||||
        }
 | 
			
		||||
        op.operationId = uniqueName;
 | 
			
		||||
        op.operationIdLowerCase = uniqueName.toLowerCase(Locale.ROOT);
 | 
			
		||||
@ -1455,7 +1454,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
 | 
			
		||||
                if (exitValue != 0) {
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue);
 | 
			
		||||
                } else {
 | 
			
		||||
                    LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                    LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
 | 
			
		||||
@ -388,7 +388,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getSchemaType(Schema p) {
 | 
			
		||||
        String schemaType = super.getSchemaType(p);
 | 
			
		||||
        LOGGER.debug("debugging OpenAPI type: " + p.getType() + ", " + p.getFormat() + " => " + schemaType);
 | 
			
		||||
        LOGGER.debug("debugging OpenAPI type: {}, {} => {}", p.getType(), p.getFormat(), schemaType);
 | 
			
		||||
        String type = null;
 | 
			
		||||
        if (typeMapping.containsKey(schemaType)) {
 | 
			
		||||
            type = typeMapping.get(schemaType);
 | 
			
		||||
@ -411,8 +411,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
            Schema additionalProperties2 = getAdditionalProperties(p);
 | 
			
		||||
            String type = additionalProperties2.getType();
 | 
			
		||||
            if (null == type) {
 | 
			
		||||
                LOGGER.error("No Type defined for Additional Property " + additionalProperties2 + "\n" //
 | 
			
		||||
                        + "\tIn Property: " + p);
 | 
			
		||||
                LOGGER.error("No Type defined for Additional Property {}\n\tIn Property: {}", additionalProperties2, p);
 | 
			
		||||
            }
 | 
			
		||||
            String inner = getSchemaType(additionalProperties2);
 | 
			
		||||
            return "(Map.Map Text " + inner + ")";
 | 
			
		||||
@ -692,7 +691,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
 | 
			
		||||
                if (exitValue != 0) {
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue);
 | 
			
		||||
                } else {
 | 
			
		||||
                    LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                    LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
                }
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
 | 
			
		||||
@ -468,7 +468,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
 | 
			
		||||
 | 
			
		||||
        } else if (REST_ASSURED.equals(getLibrary())) {
 | 
			
		||||
            if (getSerializationLibrary() == null) {
 | 
			
		||||
                LOGGER.info("No serializationLibrary configured, using '" + SERIALIZATION_LIBRARY_GSON + "' as fallback");
 | 
			
		||||
                LOGGER.info("No serializationLibrary configured, using '{}' as fallback", SERIALIZATION_LIBRARY_GSON);
 | 
			
		||||
                setSerializationLibrary(SERIALIZATION_LIBRARY_GSON);
 | 
			
		||||
            }
 | 
			
		||||
            if (SERIALIZATION_LIBRARY_JACKSON.equals(getSerializationLibrary())) {
 | 
			
		||||
@ -496,7 +496,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
 | 
			
		||||
                supportingFiles.add(new SupportingFile("kumuluzee.beans.xml.mustache", "src/main/resources/META-INF", "beans.xml"));
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            LOGGER.error("Unknown library option (-l/--library): " + getLibrary());
 | 
			
		||||
            LOGGER.error("Unknown library option (-l/--library): {}", getLibrary());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (usePlayWS) {
 | 
			
		||||
@ -553,7 +553,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (getSerializationLibrary() == null) {
 | 
			
		||||
            LOGGER.info("No serializationLibrary configured, using '" + SERIALIZATION_LIBRARY_GSON + "' as fallback");
 | 
			
		||||
            LOGGER.info("No serializationLibrary configured, using '{}' as fallback", SERIALIZATION_LIBRARY_GSON);
 | 
			
		||||
            setSerializationLibrary(SERIALIZATION_LIBRARY_GSON);
 | 
			
		||||
        }
 | 
			
		||||
        switch (getSerializationLibrary()) {
 | 
			
		||||
@ -997,7 +997,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen
 | 
			
		||||
 | 
			
		||||
    public void forceSerializationLibrary(String serializationLibrary) {
 | 
			
		||||
        if ((this.serializationLibrary != null) && !this.serializationLibrary.equalsIgnoreCase(serializationLibrary)) {
 | 
			
		||||
            LOGGER.warn("The configured serializationLibrary '" + this.serializationLibrary + "', is not supported by the library: '" + getLibrary() + "', switching back to: " + serializationLibrary);
 | 
			
		||||
            LOGGER.warn(
 | 
			
		||||
                    "The configured serializationLibrary '{}', is not supported by the library: '{}', switching back to: {}",
 | 
			
		||||
                    this.serializationLibrary, getLibrary(), serializationLibrary);
 | 
			
		||||
        }
 | 
			
		||||
        setSerializationLibrary(serializationLibrary);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -528,14 +528,15 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            String modelName = "Model" + name;
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // model name starts with number
 | 
			
		||||
        if (name.matches("^\\d.*")) {
 | 
			
		||||
            String modelName = "Model" + name; // e.g. 200Response => Model200Response (after camelize)
 | 
			
		||||
            LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name,
 | 
			
		||||
                    modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -780,7 +781,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
 | 
			
		||||
            type = openAPIType;
 | 
			
		||||
        }
 | 
			
		||||
        if (null == type) {
 | 
			
		||||
            LOGGER.error("No Type defined for Schema " + p);
 | 
			
		||||
            LOGGER.error("No Type defined for Schema {}", p);
 | 
			
		||||
        }
 | 
			
		||||
        return toModelName(type);
 | 
			
		||||
    }
 | 
			
		||||
@ -797,14 +798,14 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -1134,7 +1135,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
 | 
			
		||||
                if (exitValue != 0) {
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
 | 
			
		||||
                }
 | 
			
		||||
                LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
                // Restore interrupted state
 | 
			
		||||
 | 
			
		||||
@ -584,14 +584,15 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            String modelName = "Model" + name;
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // model name starts with number
 | 
			
		||||
        if (name.matches("^\\d.*")) {
 | 
			
		||||
            String modelName = "Model" + name; // e.g. 200Response => Model200Response (after camelize)
 | 
			
		||||
            LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName);
 | 
			
		||||
            LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name,
 | 
			
		||||
                    modelName);
 | 
			
		||||
            return modelName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -836,7 +837,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
 | 
			
		||||
            type = openAPIType;
 | 
			
		||||
        }
 | 
			
		||||
        if (null == type) {
 | 
			
		||||
            LOGGER.error("No Type defined for Schema " + p);
 | 
			
		||||
            LOGGER.error("No Type defined for Schema {}", p);
 | 
			
		||||
        }
 | 
			
		||||
        return toModelName(type);
 | 
			
		||||
    }
 | 
			
		||||
@ -853,14 +854,14 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // operationId starts with a number
 | 
			
		||||
        if (operationId.matches("^\\d.*")) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -1219,7 +1220,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
 | 
			
		||||
                if (exitValue != 0) {
 | 
			
		||||
                    LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
 | 
			
		||||
                }
 | 
			
		||||
                LOGGER.info("Successfully executed: " + command);
 | 
			
		||||
                LOGGER.info("Successfully executed: {}", command);
 | 
			
		||||
            } catch (InterruptedException | IOException e) {
 | 
			
		||||
                LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
 | 
			
		||||
                // Restore interrupted state
 | 
			
		||||
 | 
			
		||||
@ -203,7 +203,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
 | 
			
		||||
 | 
			
		||||
        // model name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(name)) {
 | 
			
		||||
            LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name));
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, camelize("model_" + name));
 | 
			
		||||
            name = "model_" + name; // e.g. return => ModelReturn (after camelize)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -298,7 +298,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem
 | 
			
		||||
        // method name cannot use reserved keyword, e.g. return
 | 
			
		||||
        if (isReservedWord(operationId)) {
 | 
			
		||||
            String newOperationId = camelize("call_" + operationId, true);
 | 
			
		||||
            LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId);
 | 
			
		||||
            LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId);
 | 
			
		||||
            return newOperationId;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -189,7 +189,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
 | 
			
		||||
        if (StringUtils.isEmpty(library)) {
 | 
			
		||||
            this.setLibrary(DEFAULT_LIBRARY);
 | 
			
		||||
            additionalProperties.put(CodegenConstants.LIBRARY, DEFAULT_LIBRARY);
 | 
			
		||||
            LOGGER.info("`library` option is empty. Default to " + DEFAULT_LIBRARY);
 | 
			
		||||
            LOGGER.info("`library` option is empty. Default to {}", DEFAULT_LIBRARY);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (additionalProperties.containsKey(Constants.AUTOMATIC_HEAD_REQUESTS)) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user