swagger-codegen
swagger-codegen copied to clipboard
[Java] How can I instruct client codegen to not use tags?
Description
I am using Java client codegen to generate client code. I don't want it to generate an API class for each tag present in my operations. Is there anyway to combine or instruct codegen to ignore tags?
The only workaround I have managed to come up with is to do the below (in my build.gradle):
def input = new CodegenConfigurator(
inputSpec: file("${rootDir}/api.yml").absolutePath,
outputDir: outputDir,
lang: 'java',
library: 'resttemplate',
additionalProperties: [
apiPackage: "${basePackage}.client".toString(),
modelPackage: "${basePackage}.client.model".toString(),
interfaceOnly: 'true',
sourceFolder: 'swagger/java/main',
jackson: 'true',
java8: 'true',
dateLibrary: 'java8'
],
systemProperties: [
apis: '',
apiDocs: 'false',
modelDocs: 'false',
apiTests: 'false',
modelTests: 'false',
models: ''
]
).setVerbose(true).toClientOptInput()
input.swagger.paths.each {key, value ->
value.operations.each {
it.tags = ['SingleClient']
}
}
new DefaultGenerator().opts(input).generate()
It seems wrong to be modifying the tags. Any other alternatives apart from me extending the DefaultGenerator itself?
Swagger-codegen version
2.4.14
have you found any solution to this?
I am just using the workaround I posted unfortunately