Closed
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
openApiGenerate {
generatorName = 'spring'
outputDir = "${buildDir}/..."
inputSpec = "${projectDir}/..."
apiPackage = "com..."
invokerPackage = "com..."
modelPackage = "com..."
instantiationTypes = [array: "java.util.HashSet"]
configOptions = [
dateLibrary : "java8",
interfaceOnly: "true"
]
}
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
4.0.1 (org.openapitools:openapi-generator-gradle-plugin:4.0.1
) - Have you search for related issues/PRs?
- What's the actual output vs expected output?
GiveninstantiationTypes = [array: "java.util.HashSet"]
Actual: ArrayLists are generated
Expected: Generated HashSets
Description
Wanted to generate HashSets instead of ArrayLists for arrays and set value for instantiationTypes
to [array: "java.util.HashSet"]
. According to answer of Slack:
Jeremie Bresson vor 16 Stunden
@Marvin please create an issue for that, it seems to me that the default value is hard-coded and not using this instantiationTypes parameter.
See:
openapi-generator version
4.0.1, not a regression
OpenAPI declaration file content or url
openApiGenerate {
generatorName = 'spring'
outputDir = "${buildDir}/..."
inputSpec = "${projectDir}/..."
apiPackage = "com..."
invokerPackage = "com..."
modelPackage = "com..."
instantiationTypes = [array: "java.util.HashSet"]
configOptions = [
dateLibrary : "java8",
interfaceOnly: "true"
]
}
Command line used for generation
gradle clean openApiGenerate
Steps to reproduce
Just set instantiationTypes according to example above.