forked from loafle/openapi-generator-original
Merge branch 'issue-2743' of https://github.com/mikolajprzybysz/swagger-codegen into mikolajprzybysz-issue-2743
This commit is contained in:
@@ -37,9 +37,13 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
protected String packagePath = "SwaggerClient-php";
|
||||
protected String artifactVersion = "1.0.0";
|
||||
protected String srcBasePath = "lib";
|
||||
protected String testBasePath = "test";
|
||||
protected String docsBasePath = "docs";
|
||||
protected String apiDirName = "Api";
|
||||
protected String modelDirName = "Model";
|
||||
protected String variableNamingConvention= "snake_case";
|
||||
protected String apiDocPath = "docs/";
|
||||
protected String modelDocPath = "docs/";
|
||||
protected String apiDocPath = docsBasePath + "/" + apiDirName;
|
||||
protected String modelDocPath = docsBasePath + "/" + modelDirName;
|
||||
|
||||
public PhpClientCodegen() {
|
||||
super();
|
||||
@@ -51,9 +55,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
modelTestTemplateFiles.put("model_test.mustache", ".php");
|
||||
apiTestTemplateFiles.put("api_test.mustache", ".php");
|
||||
embeddedTemplateDir = templateDir = "php";
|
||||
apiPackage = invokerPackage + "\\Api";
|
||||
modelPackage = invokerPackage + "\\Model";
|
||||
testPackage = invokerPackage + "\\Tests";
|
||||
apiPackage = invokerPackage + "\\" + apiDirName;
|
||||
modelPackage = invokerPackage + "\\" + modelDirName;
|
||||
|
||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||
apiDocTemplateFiles.put("api_doc.mustache", ".md");
|
||||
@@ -233,6 +236,9 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
additionalProperties.put("apiDocPath", apiDocPath);
|
||||
additionalProperties.put("modelDocPath", modelDocPath);
|
||||
|
||||
// make test path available in mustache template
|
||||
additionalProperties.put("testBasePath", testBasePath);
|
||||
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", toPackagePath(invokerPackage, srcBasePath), "Configuration.php"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", toPackagePath(invokerPackage, srcBasePath), "ApiClient.php"));
|
||||
supportingFiles.add(new SupportingFile("ApiException.mustache", toPackagePath(invokerPackage, srcBasePath), "ApiException.php"));
|
||||
@@ -262,23 +268,21 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@Override
|
||||
public String apiTestFileFolder() {
|
||||
return (outputFolder + "/" + toPackagePath(testPackage, srcBasePath));
|
||||
return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + apiDirName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelTestFileFolder() {
|
||||
return (outputFolder + "/" + toPackagePath(testPackage, srcBasePath));
|
||||
return (outputFolder + "/" + getPackagePath() + "/" + testBasePath + "/" + modelDirName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apiDocFileFolder() {
|
||||
//return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
|
||||
return (outputFolder + "/" + getPackagePath() + "/" + apiDocPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelDocFileFolder() {
|
||||
//return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||
return (outputFolder + "/" + getPackagePath() + "/" + modelDocPath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user