mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 06:57:11 +00:00
[maven-plugin] Allow to set User-Agent (#3777)
This commit is contained in:
committed by
Jérémie Bresson
parent
5a54aa5726
commit
d36dd47b12
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user