property renames

This commit is contained in:
Tony Tam 2014-09-10 06:13:49 -07:00
parent d5e62086c8
commit cab4ffa286
4 changed files with 11 additions and 9 deletions

View File

@ -22,11 +22,11 @@ import com.wordnik.swagger.models.Swagger;
public class ClientOptInput {
private ClientOpts opts;
private Swagger model;
private Swagger swagger;
protected CodegenConfig config;
public ClientOptInput model(Swagger model) {
this.setModel(model);
public ClientOptInput swagger(Swagger swagger) {
this.setSwagger(swagger);
return this;
}
public ClientOptInput opts(ClientOpts opts) {
@ -49,11 +49,11 @@ public class ClientOptInput {
return opts;
}
public void setModel(Swagger model) {
this.model = model;
public void setSwagger(Swagger swagger) {
this.swagger = swagger;
}
public Swagger getModel() {
return model;
public Swagger getSwagger() {
return swagger;
}
}

View File

@ -39,7 +39,7 @@ public class Codegen extends DefaultGenerator {
try{
codegenInput
.opts(clientArgs)
.model(swagger);
.swagger(swagger);
new Codegen().opts(codegenInput).generate();
}

View File

@ -381,6 +381,8 @@ public class DefaultCodegen {
if(languageSpecificPrimitives().contains(type))
property.isPrimitiveType = true;
}
if("id".equals(property.name))
Json.prettyPrint(property);
return property;
}

View File

@ -20,7 +20,7 @@ public class DefaultGenerator implements Generator {
public Generator opts(ClientOptInput opts) {
this.opts = opts;
this.swagger = opts.getModel();
this.swagger = opts.getSwagger();
ClientOpts clientOpts = opts.getOpts();
this.config = opts.getConfig();