[maven-plugin] Allow to set User-Agent (#3777)

This commit is contained in:
Martin Hátaš
2019-08-28 10:17:41 +02:00
committed by Jérémie Bresson
parent 5a54aa5726
commit d36dd47b12
2 changed files with 11 additions and 0 deletions

View File

@@ -206,6 +206,12 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "ignoreFileOverride", property = "openapi.generator.maven.plugin.ignoreFileOverride", required = false)
private String ignoreFileOverride;
/**
* Sets custom User-Agent header value
*/
@Parameter(name = "httpUserAgent", property = "openapi.generator.maven.plugin.httpUserAgent", required = false)
private String httpUserAgent;
/**
* To remove operationId prefix (e.g. user_getName => getName)
*/
@@ -462,6 +468,10 @@ public class CodeGenMojo extends AbstractMojo {
configurator.setIgnoreFileOverride(ignoreFileOverride);
}
if (isNotEmpty(httpUserAgent)) {
configurator.setHttpUserAgent(httpUserAgent);
}
if (skipValidateSpec != null) {
configurator.setValidateSpec(!skipValidateSpec);
}