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 {}",
|
"'{}' defines discriminator '{}', but the referenced OneOf schema '{}' is missing {}",
|
||||||
composedSchemaName, discPropName, modelName, discPropName);
|
composedSchemaName, discPropName, modelName, discPropName);
|
||||||
}
|
}
|
||||||
if (cp.dataType == null) {
|
if (cp != null && cp.dataType == null) {
|
||||||
cp = thisCp;
|
cp = thisCp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -350,7 +350,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
} else {
|
} else {
|
||||||
typDecl = "interface{}";
|
typDecl = "interface{}";
|
||||||
}
|
}
|
||||||
if (Boolean.TRUE.equals(inner.getNullable())) {
|
if (inner != null && Boolean.TRUE.equals(inner.getNullable())) {
|
||||||
typDecl = "*" + typDecl;
|
typDecl = "*" + typDecl;
|
||||||
}
|
}
|
||||||
return "[]" + typDecl;
|
return "[]" + typDecl;
|
||||||
|
@ -71,10 +71,9 @@ public class CppTinyClientCodegen extends AbstractCppCodegen implements CodegenC
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addControllerToAdditionalProperties() {
|
public void addControllerToAdditionalProperties() {
|
||||||
Map<String, String> supportedControllers = new HashMap<String, String>() {{
|
Map<String, String> supportedControllers = new HashMap<String, String>();
|
||||||
put("esp32", "isESP32");
|
supportedControllers.put("esp32", "isESP32");
|
||||||
put("esp8266", "isESP8266");
|
supportedControllers.put("esp8266", "isESP8266");
|
||||||
}};
|
|
||||||
if (supportedControllers.containsKey(controller)) {
|
if (supportedControllers.containsKey(controller)) {
|
||||||
additionalProperties.put(supportedControllers.get(controller), true);
|
additionalProperties.put(supportedControllers.get(controller), true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1195,7 +1195,11 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
|||||||
|
|
||||||
// this seed makes it so if we have [a-z] we pick a
|
// this seed makes it so if we have [a-z] we pick a
|
||||||
Random random = new Random(18);
|
Random random = new Random(18);
|
||||||
|
if (rgxGen != null) {
|
||||||
example = rgxGen.generate(random);
|
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) {
|
} else if (schema.getMinLength() != null) {
|
||||||
example = "";
|
example = "";
|
||||||
int len = schema.getMinLength().intValue();
|
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
|
// this seed makes it so if we have [a-z] we pick a
|
||||||
Random random = new Random(18);
|
Random random = new Random(18);
|
||||||
|
if (rgxGen != null){
|
||||||
example = rgxGen.generate(random);
|
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) {
|
} else if (schema.getMinLength() != null) {
|
||||||
example = "";
|
example = "";
|
||||||
int len = schema.getMinLength().intValue();
|
int len = schema.getMinLength().intValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user