forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
This commit is contained in:
@@ -93,7 +93,7 @@ public class ExampleGenerator {
|
||||
};
|
||||
}
|
||||
} else if (property instanceof DateProperty) {
|
||||
return "2000-01-23T04:56:07.000+00:00";
|
||||
return "2000-01-23";
|
||||
} else if (property instanceof DateTimeProperty) {
|
||||
return "2000-01-23T04:56:07.000+00:00";
|
||||
} else if (property instanceof DecimalProperty) {
|
||||
|
||||
@@ -180,7 +180,7 @@ public class XmlExampleGenerator {
|
||||
if (property.getExample() != null) {
|
||||
return property.getExample().toString();
|
||||
} else {
|
||||
return "2000-01-23T04:56:07.000Z";
|
||||
return "2000-01-23";
|
||||
}
|
||||
} else if (property instanceof IntegerProperty) {
|
||||
if (property.getExample() != null) {
|
||||
|
||||
@@ -390,7 +390,6 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
||||
|
||||
// need to put back serializableModel (boolean) into additionalProperties as value in additionalProperties is string
|
||||
additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel);
|
||||
LOGGER.info("CodegenConstants.SERIALIZABLE_MODEL = " + additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL));
|
||||
|
||||
//make api and model doc path available in mustache template
|
||||
additionalProperties.put( "apiDocPath", apiDocPath );
|
||||
|
||||
@@ -21,6 +21,9 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
||||
protected String packageVersion = "1.0.0";
|
||||
protected String clientPackage = "IO.Swagger.Client";
|
||||
protected String sourceFolder = "src" + File.separator + "main" + File.separator + "CsharpDotNet2";
|
||||
protected String apiDocPath = "docs/";
|
||||
protected String modelDocPath = "docs/";
|
||||
|
||||
|
||||
public CsharpDotNet2ClientCodegen() {
|
||||
super();
|
||||
@@ -35,6 +38,8 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
||||
embeddedTemplateDir = templateDir = "CsharpDotNet2";
|
||||
apiPackage = "IO.Swagger.Api";
|
||||
modelPackage = "IO.Swagger.Model";
|
||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
@@ -122,6 +127,9 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
||||
additionalProperties.put(CLIENT_PACKAGE, clientPackage);
|
||||
}
|
||||
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("Configuration.mustache",
|
||||
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "Configuration.cs"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache",
|
||||
@@ -130,7 +138,7 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
||||
sourceFolder + File.separator + clientPackage.replace(".", java.io.File.separator), "ApiException.cs"));
|
||||
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config"));
|
||||
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
|
||||
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
|
||||
}
|
||||
|
||||
@@ -292,4 +300,14 @@ public class CsharpDotNet2ClientCodegen extends DefaultCodegen implements Codege
|
||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelDocFileFolder() {
|
||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user