Merge branch 'develop_2.0' of ssh://github.com/tiffanyperumpail/swagger-codegen into tiffanyperumpail-develop_2.0

This commit is contained in:
Tony Tam
2015-08-23 17:24:27 -07:00
2 changed files with 14 additions and 6 deletions

View File

@@ -1,8 +1,11 @@
package io.swagger.codegen;
import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import io.swagger.codegen.languages.CodeGenStatus;
import io.swagger.models.ComposedModel;
import io.swagger.models.Contact;
import io.swagger.models.Info;
@@ -15,7 +18,6 @@ import io.swagger.models.auth.OAuth2Definition;
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.joda.time.DateTime;
@@ -36,14 +38,13 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
public class DefaultGenerator extends AbstractGenerator implements Generator {
protected CodegenConfig config;
protected ClientOptInput opts = null;
protected Swagger swagger = null;
public CodeGenStatus status = CodeGenStatus.UNRUN;
public Generator opts(ClientOptInput opts) {
this.opts = opts;
@@ -315,8 +316,10 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
}
config.processSwagger(swagger);
status = CodeGenStatus.SUCCESSFUL;
} catch (Exception e) {
e.printStackTrace();
status = CodeGenStatus.FAILED;
}
return files;
}

View File

@@ -0,0 +1,5 @@
package io.swagger.codegen.languages;
public enum CodeGenStatus {
UNRUN, SUCCESSFUL, FAILED
}