-D option has been deprecated as it was previously used to:
* Pass "system properties"
* Pass additional properties
This was confusing because we already have --additional-properties and
because Java System Properties are passed as -D before program
arguments.
Confusion around the -D option had existed for some time, but when we
introduced the thread-safe GlobalSettings to avoid overwriting Java
System Properties, we created a hard break from Java System Properties
in the generator. This also disconnected the previous "system
properties" from accepting additional properties.
Once these newly deprecated methods are removed, we will have a clear
separation of concerns between:
* Java System Properties
* Global generator properties (used as workflow context)
* Additional properties (used as generator options)
This commit marks multiple places for cleanup in 5.0. These will be
breaking changes, and lower effort to break in 5.0 with deprecation
warnings now rather than adding sibling properties throughout the code
and potentially introducing logic errors.
* [cli] Validate now uses parseOptions w/setResolve
The validate command now uses ParseOptions#setResolve(true) to match how
we parse in CodegenConfigurator and online's Generate. Without this
option, the OpenAPI 3 parser skips the "resolve" block, which made lead
to validations in the command not matching validations during
generation.
* [gradle] Validate now uses parseOptions w/setResolve
The Graldle validate command now uses ParseOptions#setResolve(true) to match how
we parse in CodegenConfigurator and online's Generate. Without this
option, the OpenAPI 3 parser skips the "resolve" block, which made lead
to validations in the command not matching validations during
generation.
* [gradle] Add recommendations to validate task
* Use current version of Gradle Plugin in build checks.
* Fix gradle project build version confusion in CI
* [gradle] Bump samples to 5.2.1 wrapper
Previously, the Gradle plugin was building in CI against
openapi-generator 4.2.0 and Gradle version 4.10.2. At some point, a
contribution was made with an API which is incomatible at 4.10.2 and due
to a release script error which pinned the local-spec version to release
4.2.0, we didn't notice this inconsistency.
This bumps the project to build against Gradle 5.2.1.
* [doc] Update versions missed during release
Removed old script bin/utils/release_version_update_docs.sh to avoid
confusion. New script solves issues of not "globally" replacing.
New script is at:
bin/utils/release/release_version_update_docs.sh
* Update Gradle Plugin README with correct version
* Update gradle.properties to correct version
* Spotbugs, PMD and Checkstyle #33
* Reducing Spotbugs effort to min #33
* Also using project.parent.basedir and avoiding relative paths in pom files.
* Filtering out samples.
* Move PMD/Spotbugs to static-analysis profile
This moves the static-analysis checks to a standalone profile. Core
contributors may run static analysis with:
```
mvn -Pstatic-analysis install
```
The analysis is separated from default functionality to reduce impact to
community contributions. SpotBugs/PMD may add a non-trivial amount of
time to builds on some machines.
Co-authored-by: Tomas Bjerre <tomas.bjerre85@gmail.com>
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.