[python] Add packageUrl option, replacing infoUrl in setup.py (#4101)

* [python] Add packageUrl option, replacing infoUrl in setup.py .

* [python] Regenerate Python petstore sample.

* [python] Regenerate Python petstore security test sample.
This commit is contained in:
Cliffano Subagio
2016-11-01 21:21:53 +11:00
committed by wing328
parent 0c1b1aa749
commit 5c53513a30
16 changed files with 221 additions and 169 deletions

View File

@@ -1,6 +1,7 @@
package io.swagger.codegen.options;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.languages.PythonClientCodegen;
import com.google.common.collect.ImmutableMap;
@@ -9,6 +10,7 @@ import java.util.Map;
public class PythonClientOptionsProvider implements OptionsProvider {
public static final String PACKAGE_NAME_VALUE = "swagger_client_python";
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String PACKAGE_URL_VALUE = "";
@Override
public String getLanguage() {
@@ -18,7 +20,8 @@ public class PythonClientOptionsProvider implements OptionsProvider {
@Override
public Map<String, String> createOptions() {
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
return builder.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
return builder.put(PythonClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE)
.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")

View File

@@ -30,6 +30,8 @@ public class PythonClientOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE);
times = 1;
clientCodegen.setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE);
times = 1;
}};
}
}