added bootstrap, renamed sample

This commit is contained in:
Tony Tam
2016-04-02 18:34:58 -06:00
parent 63d2784bbf
commit 4bb12871c3
67 changed files with 3558 additions and 1141 deletions

View File

@@ -9,6 +9,7 @@ import io.swagger.models.parameters.*;
import io.swagger.models.properties.*;
import io.swagger.models.properties.PropertyBuilder.PropertyId;
import io.swagger.util.Json;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -169,11 +170,7 @@ public class DefaultCodegen {
@SuppressWarnings("static-method")
public String escapeText(String input) {
if (input != null) {
String output = input.trim().replaceAll("\n", "\\\\n");
output = output.replace("\r", "\\r");
output = output.replace("\"", "\\\"");
return output;
return StringEscapeUtils.escapeJava(input).replace("\\/", "/");
}
return input;
}

View File

@@ -8,6 +8,7 @@ import io.swagger.models.auth.SecuritySchemeDefinition;
import io.swagger.models.parameters.Parameter;
import io.swagger.util.Json;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,7 +17,6 @@ import java.io.*;
import java.util.*;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import org.apache.commons.lang3.ObjectUtils;
public class DefaultGenerator extends AbstractGenerator implements Generator {
protected Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class);