forked from loafle/openapi-generator-original
Simplified enum by changing CodeGenStatus to an enum instead of a wrapper. Updated version of swagger-parser to 1.0.9.
This commit is contained in:
parent
1b31a01b76
commit
5328c00e8f
@ -1,8 +1,5 @@
|
||||
package io.swagger.codegen;
|
||||
|
||||
import static io.swagger.codegen.languages.CodeGenStatus.Status.FAILED;
|
||||
import static io.swagger.codegen.languages.CodeGenStatus.Status.SUCCESSFUL;
|
||||
import static io.swagger.codegen.languages.CodeGenStatus.Status.UNRUN;
|
||||
import static org.apache.commons.lang3.StringUtils.capitalize;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
@ -44,7 +41,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
protected ClientOptInput opts = null;
|
||||
protected Swagger swagger = null;
|
||||
|
||||
public CodeGenStatus status = new CodeGenStatus(UNRUN);
|
||||
public CodeGenStatus status = CodeGenStatus.UNRUN;
|
||||
|
||||
public Generator opts(ClientOptInput opts) {
|
||||
this.opts = opts;
|
||||
@ -310,9 +307,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
|
||||
config.processSwagger(swagger);
|
||||
|
||||
status.setStatus(SUCCESSFUL);
|
||||
status = CodeGenStatus.SUCCESSFUL;
|
||||
} catch (Exception e) {
|
||||
status.setStatus(FAILED);
|
||||
status = CodeGenStatus.FAILED;
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
@ -1,21 +1,5 @@
|
||||
package io.swagger.codegen.languages;
|
||||
|
||||
public class CodeGenStatus {
|
||||
public enum Status {
|
||||
public enum CodeGenStatus {
|
||||
UNRUN, SUCCESSFUL, FAILED
|
||||
};
|
||||
|
||||
private Status status;
|
||||
|
||||
public CodeGenStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
2
pom.xml
2
pom.xml
@ -456,7 +456,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>1.0.9-SNAPSHOT</swagger-parser-version>
|
||||
<swagger-parser-version>1.0.9</swagger-parser-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>2.3.4</felix-version>
|
||||
<swagger-core-version>1.5.0</swagger-core-version>
|
||||
|
Loading…
x
Reference in New Issue
Block a user