From 74b0c04b2fd1560c74e68bb3a112eb37b93a5a7f Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 11 Jul 2017 21:57:00 +0800 Subject: [PATCH] replace tab with 4-space in restbed class --- .../codegen/languages/RestbedCodegen.java | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java index 79134c513f1..070f4de3ca1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RestbedCodegen.java @@ -227,52 +227,52 @@ public class RestbedCodegen extends AbstractCppCodegen { @SuppressWarnings("unchecked") @Override public Map postProcessOperations(Map objs) { - Map operations = (Map) objs.get("operations"); - List operationList = (List) operations.get("operation"); - List newOpList = new ArrayList(); - for (CodegenOperation op : operationList) { - String path = new String(op.path); + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + List newOpList = new ArrayList(); + for (CodegenOperation op : operationList) { + String path = new String(op.path); - String[] items = path.split("/", -1); - String resourceNameCamelCase = ""; - op.path = ""; - for (String item: items) { - if (item.length() > 1) { - if (item.matches("^\\{(.*)\\}$")) { - String tmpResourceName = item.substring(1, item.length()-1); - resourceNameCamelCase += Character.toUpperCase(tmpResourceName.charAt(0)) + tmpResourceName.substring(1); - item = item.substring(0, item.length()-1); - item += ": .*}"; - } else { - resourceNameCamelCase += Character.toUpperCase(item.charAt(0)) + item.substring(1); + String[] items = path.split("/", -1); + String resourceNameCamelCase = ""; + op.path = ""; + for (String item: items) { + if (item.length() > 1) { + if (item.matches("^\\{(.*)\\}$")) { + String tmpResourceName = item.substring(1, item.length()-1); + resourceNameCamelCase += Character.toUpperCase(tmpResourceName.charAt(0)) + tmpResourceName.substring(1); + item = item.substring(0, item.length()-1); + item += ": .*}"; + } else { + resourceNameCamelCase += Character.toUpperCase(item.charAt(0)) + item.substring(1); + } + } else if (item.length() == 1) { + resourceNameCamelCase += Character.toUpperCase(item.charAt(0)); + } + op.path += item + "/"; } - } else if (item.length() == 1) { - resourceNameCamelCase += Character.toUpperCase(item.charAt(0)); - } - op.path += item + "/"; - } - op.vendorExtensions.put("x-codegen-resourceName", resourceNameCamelCase); - boolean foundInNewList = false; - for (CodegenOperation op1 : newOpList) { - if (!foundInNewList) { - if (op1.path.equals(op.path)) { - foundInNewList = true; - List currentOtherMethodList = (List) op1.vendorExtensions.get("x-codegen-otherMethods"); - if (currentOtherMethodList == null) { - currentOtherMethodList = new ArrayList(); - } - op.operationIdCamelCase = op1.operationIdCamelCase; - currentOtherMethodList.add(op); - op1.vendorExtensions.put("x-codegen-otherMethods", currentOtherMethodList); + op.vendorExtensions.put("x-codegen-resourceName", resourceNameCamelCase); + boolean foundInNewList = false; + for (CodegenOperation op1 : newOpList) { + if (!foundInNewList) { + if (op1.path.equals(op.path)) { + foundInNewList = true; + List currentOtherMethodList = (List) op1.vendorExtensions.get("x-codegen-otherMethods"); + if (currentOtherMethodList == null) { + currentOtherMethodList = new ArrayList(); + } + op.operationIdCamelCase = op1.operationIdCamelCase; + currentOtherMethodList.add(op); + op1.vendorExtensions.put("x-codegen-otherMethods", currentOtherMethodList); + } + } + } + if (!foundInNewList) { + newOpList.add(op); } - } } - if (!foundInNewList) { - newOpList.add(op); - } - } - operations.put("operation", newOpList); - return objs; + operations.put("operation", newOpList); + return objs; } /**