Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public JavaDubboServerCodegen() {
typeMapping.put("uuid", "UUID");
typeMapping.put("byte", "byte[]");
typeMapping.put("ByteArray", "byte[]");
typeMapping.put("binary", "byte[]");
typeMapping.put("password", "String");

languageSpecificPrimitives.clear();
Expand Down Expand Up @@ -276,13 +275,6 @@ public String outputFolder() {
return outputFolder;
}

public String getIgnoreFileOutputPath() {
if (isOutputFolderPointingToSourceDirectory()) {
return outputFolder + File.separator + ".." + File.separator + ".." + File.separator + "..";
}
return outputFolder;
}

@Override
public void processOpts() {
final List<org.apache.commons.lang3.tuple.Pair<String, String>> configOptions =
Expand Down Expand Up @@ -405,7 +397,6 @@ public void processOpts() {
if (isUserTitle) {
String titleName = (String) additionalProperties.get(TITLE);
mainClassName = (camelize(titleName.trim(), CamelizeOption.UPPERCASE_FIRST_CHAR) + "Application").replaceAll("\\s+", "");
;
} else {
mainClassName = "OpenApiGeneratorApplication";
}
Expand Down Expand Up @@ -466,7 +457,7 @@ private boolean isDubbo33OrHigher(String version) {
return major > 3 || (major == 3 && minor >= 3);
}
} catch (NumberFormatException e) {
LOGGER.warn("Unable to parse Dubbo version: " + version);
LOGGER.warn("Unable to parse Dubbo version: {}", version);
}

return false;
Expand Down Expand Up @@ -608,17 +599,6 @@ public String getFileFolderForTemplate(String templateName) {
return baseFolder;
}

public String getPackageForTemplate(String templateName) {
if ("api.mustache".equals(templateName)) {
return apiPackage() + ".interfaces";
} else if ("apiController.mustache".equals(templateName)) {
return apiPackage() + ".consumer";
} else if ("apiDubbo.mustache".equals(templateName)) {
return apiPackage() + ".provider";
}
return apiPackage();
}

@Override
public String modelFileFolder() {
if (isOutputFolderPointingToSourceDirectory()) {
Expand Down Expand Up @@ -656,7 +636,7 @@ public String apiFilename(String templateName, String tag) {

@Override
public String toApiName(String name) {
if (name.length() == 0) {
if (name.isEmpty()) {
return "DefaultService";
}
name = sanitizeName(name);
Expand All @@ -681,7 +661,7 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
basePath = basePath.substring(0, pos);
}

if (basePath.length() == 0) {
if (basePath.isEmpty()) {
basePath = "default";
} else {
String subPath = resourcePath;
Expand All @@ -693,7 +673,6 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
}
co.vendorExtensions.put("x-sub-path", subPath);
co.subresourceOperation = !subPath.equals("/");

co.vendorExtensions.put("x-base-path", "/" + basePath);

if ("a".equals(basePath)) {
Expand All @@ -710,19 +689,14 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
}
}

@Override
public boolean isDataTypeString(String dataType) {
return "String".equals(dataType);
}

@Override
public String getTypeDeclaration(Schema p) {
if (ModelUtils.isArraySchema(p)) {
Schema inner = ModelUtils.getSchemaItems(p);
Schema<?> inner = ModelUtils.getSchemaItems(p);
String innerType = getTypeDeclaration(inner);
return "List<" + innerType + ">";
} else if (ModelUtils.isMapSchema(p)) {
Schema inner = ModelUtils.getAdditionalProperties(p);
Schema<?> inner = ModelUtils.getAdditionalProperties(p);
String innerType = getTypeDeclaration(inner);
return "Map<String, " + innerType + ">";
}
Expand Down
Loading