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.
see #3815 (closed)
I'm tagging with Gradle Plugin because this is where it was noticed. This likely affects CLI/Maven plugin as well for version 4.1.1 through 4.2.0.
cc @OpenAPITools/generator-core-team
To test, build locally, then:
cd modules/openapi-generator-gradle-plugin
./gradlew publishToMavenLocal
cd samples/local-spec
gradle -PopenApiGeneratorVersion=4.2.1-SNAPSHOT buildDotnetSdk
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project before. -
Run the shell script(s) under ./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc). -
File the PR against the correct branch: master
,4.3.x
,5.0.x
. Default:master
. -
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.