mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 22:42:43 +00:00
[core] Fix system properties being immutable (#4447)
When WorkflowSettings was constructed from an existing instance, as is
the case when we deserialize from an external configuration file, it
would result in an error:
Caused by: java.lang.UnsupportedOperationException
at com.google.common.collect.ImmutableMap.put(ImmutableMap.java:450)
at org.openapitools.codegen.config.WorkflowSettings$Builder.withSystemProperty(WorkflowSettings.java:465)
This was due to an error in `newBuilder(WorkflowSettings copy)` which
assigned builder.systemProperties with an immutable map. This is
incorrect because everything in the builder should be mutable until
.build() is invoked.
This likely affects CLI/Maven plugin as well for version 4.1.1 through 4.2.0.
This commit is contained in:
@@ -11,6 +11,7 @@ gradle openApiGenerate
|
||||
gradle openApiMeta
|
||||
gradle openApiValidate
|
||||
gradle buildGoSdk
|
||||
gradle buildDotnetSdk
|
||||
gradle generateGoWithInvalidSpec
|
||||
```
|
||||
|
||||
|
||||
@@ -65,6 +65,20 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
|
||||
]
|
||||
}
|
||||
|
||||
task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
generatorName = "csharp-netcore"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
additionalProperties = [
|
||||
packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
|
||||
useCompareNetObjects: "true"
|
||||
]
|
||||
outputDir = "$buildDir/csharp-netcore".toString()
|
||||
systemProperties = [
|
||||
models: "",
|
||||
apis : "",
|
||||
]
|
||||
}
|
||||
|
||||
task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
validateSpec = true
|
||||
generatorName = "go"
|
||||
|
||||
Reference in New Issue
Block a user