forked from loafle/openapi-generator-original
add httpUserAgent option, add customized user-agent support to C#
This commit is contained in:
@@ -117,6 +117,9 @@ public class Generate implements Runnable {
|
||||
|
||||
@Option(name = {"--release-version"}, title = "release version", description = CodegenConstants.RELEASE_VERSION_DESC)
|
||||
private String releaseVersion;
|
||||
|
||||
@Option(name = {"--http-user-agent"}, title = "http user agent", description = CodegenConstants.HTTP_USER_AGENT)
|
||||
private String httpUserAgent;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -210,6 +213,10 @@ public class Generate implements Runnable {
|
||||
if (isNotEmpty(releaseVersion)) {
|
||||
configurator.setReleaseVersion(releaseVersion);
|
||||
}
|
||||
|
||||
if (isNotEmpty(httpUserAgent)) {
|
||||
configurator.setHttpUserAgent(httpUserAgent);
|
||||
}
|
||||
|
||||
applySystemPropertiesKvp(systemProperties, configurator);
|
||||
applyInstantiationTypesKvp(instantiationTypes, configurator);
|
||||
|
||||
Reference in New Issue
Block a user