Merge branch 'master' of https://github.com/swagger-api/swagger-codegen into php_api_doc

This commit is contained in:
wing328
2016-03-16 11:42:27 +08:00
124 changed files with 4712 additions and 3276 deletions

View File

@@ -180,8 +180,8 @@ public interface CodegenConfig {
String getReleaseNote();
void setReleaseVersion(String releaseVersion);
void setHttpUserAgent(String httpUserAgent);
String getReleaseVersion();
String getHttpUserAgent();
}

View File

@@ -100,7 +100,7 @@ public class CodegenConstants {
public static final String RELEASE_NOTE = "releaseNote";
public static final String RELEASE_NOTE_DESC = "Release note, default to 'Minor update'.";
public static final String RELEASE_VERSION = "releaseVersion";
public static final String RELEASE_VERSION_DESC= "Release version, e.g. 1.2.5, default to 0.1.0.";
public static final String HTTP_USER_AGENT = "httpUserAgent";
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{packageVersion}}/{language}'";
}

View File

@@ -83,7 +83,8 @@ public class DefaultCodegen {
protected String library;
protected Boolean sortParamsByRequiredFlag = true;
protected Boolean ensureUniqueParams = true;
protected String gitUserId, gitRepoId, releaseNote, releaseVersion;
protected String gitUserId, gitRepoId, releaseNote;
protected String httpUserAgent;
public List<CliOption> cliOptions() {
return cliOptions;
@@ -2414,21 +2415,21 @@ public class DefaultCodegen {
}
/**
* Set release version.
* Set HTTP user agent.
*
* @param releaseVersion Release version
* @param httpUserAgent HTTP user agent
*/
public void setReleaseVersion(String releaseVersion) {
this.releaseVersion = releaseVersion;
public void setHttpUserAgent(String httpUserAgent) {
this.httpUserAgent = httpUserAgent;
}
/**
* Release version
* HTTP user agent
*
* @return Release version
* @return HTTP user agent
*/
public String getReleaseVersion() {
return releaseVersion;
public String getHttpUserAgent() {
return httpUserAgent;
}
@SuppressWarnings("static-method")

View File

@@ -63,7 +63,7 @@ public class CodegenConfigurator {
private String gitUserId="YOUR_GIT_USR_ID";
private String gitRepoId="YOUR_GIT_REPO_ID";
private String releaseNote="Minor update";
private String releaseVersion="0.1.0";
private String httpUserAgent;
private final Map<String, String> dynamicProperties = new HashMap<String, String>(); //the map that holds the JsonAnySetter/JsonAnyGetter values
@@ -326,12 +326,12 @@ public class CodegenConfigurator {
return this;
}
public String getReleaseVersion() {
return releaseVersion;
public String getHttpUserAgent() {
return httpUserAgent;
}
public CodegenConfigurator setReleaseVersion(String releaseVersion) {
this.releaseVersion = releaseVersion;
public CodegenConfigurator setHttpUserAgent(String httpUserAgent) {
this.httpUserAgent= httpUserAgent;
return this;
}
@@ -364,8 +364,8 @@ public class CodegenConfigurator {
checkAndSetAdditionalProperty(modelNameSuffix, CodegenConstants.MODEL_NAME_SUFFIX);
checkAndSetAdditionalProperty(gitUserId, CodegenConstants.GIT_USER_ID);
checkAndSetAdditionalProperty(gitRepoId, CodegenConstants.GIT_REPO_ID);
checkAndSetAdditionalProperty(releaseVersion, CodegenConstants.RELEASE_VERSION);
checkAndSetAdditionalProperty(releaseNote, CodegenConstants.RELEASE_NOTE);
checkAndSetAdditionalProperty(httpUserAgent, CodegenConstants.HTTP_USER_AGENT);
handleDynamicProperties(config);