forked from loafle/openapi-generator-original
minor code improvement based on sonarcloud reports (#10364)
This commit is contained in:
parent
9464999d9c
commit
592cb64465
@ -2834,7 +2834,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
"'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}",
|
||||
composedSchemaName, discPropName, modelName, discPropName);
|
||||
}
|
||||
if (cp.dataType == null) {
|
||||
if (cp != null && cp.dataType == null) {
|
||||
cp = thisCp;
|
||||
continue;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
} else {
|
||||
typDecl = "interface{}";
|
||||
}
|
||||
if (Boolean.TRUE.equals(inner.getNullable())) {
|
||||
if (inner != null && Boolean.TRUE.equals(inner.getNullable())) {
|
||||
typDecl = "*" + typDecl;
|
||||
}
|
||||
return "[]" + typDecl;
|
||||
|
@ -71,10 +71,9 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC
|
||||
}
|
||||
|
||||
public void addControllerToAdditionalProperties() {
|
||||
Map<String, String> supportedControllers = new HashMap<String, String>() {{
|
||||
put("esp32", "isESP32");
|
||||
put("esp8266", "isESP8266");
|
||||
}};
|
||||
Map<String, String> supportedControllers = new HashMap<String, String>();
|
||||
supportedControllers.put("esp32", "isESP32");
|
||||
supportedControllers.put("esp8266", "isESP8266");
|
||||
if (supportedControllers.containsKey(controller)) {
|
||||
additionalProperties.put(supportedControllers.get(controller), true);
|
||||
} else {
|
||||
|
@ -1195,7 +1195,11 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
||||
|
||||
// this seed makes it so if we have [a-z] we pick a
|
||||
Random random = new Random(18);
|
||||
if (rgxGen != null) {
|
||||
example = rgxGen.generate(random);
|
||||
} else {
|
||||
throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo.");
|
||||
}
|
||||
} else if (schema.getMinLength() != null) {
|
||||
example = "";
|
||||
int len = schema.getMinLength().intValue();
|
||||
|
@ -1180,7 +1180,11 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
// this seed makes it so if we have [a-z] we pick a
|
||||
Random random = new Random(18);
|
||||
if (rgxGen != null){
|
||||
example = rgxGen.generate(random);
|
||||
} else {
|
||||
throw new RuntimeException("rgxGen cannot be null. Please open an issue in the openapi-generator github repo.");
|
||||
}
|
||||
} else if (schema.getMinLength() != null) {
|
||||
example = "";
|
||||
int len = schema.getMinLength().intValue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user