-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.
* Flatten feature sets for display
* [cli] Add feature set output to config-help
This includes markdown and plain text outputs for config-help.
* [docs] FeatureSet on generator docs
* Fixes issue with templates loading via classpath
The templating engines were originally written to load templates via the
classpath, but this functionality was blocked by file-only checks
further up the stack. This loosens those file-only checks, allowing
files and relatively imported files to be included via classpath.
* [docs] Add details about classpath-level templates
* [feat][maven] templateResourcePath for template on classpath
- NOTE templateResourcePath is not needed for gradle, as it accepts
a string for the target template directory, which supports classpath
* [core] Extracting recommendations to validation framework
This is work to extract recommendation logic out of the CLI validate command
into a shared evaluation instance which can be used elsewhere (such as Gradle,
or the Online tool).
For now, these validations are in addition to those provided by swagger-parser and
are only the following recommendations:
* Apache/Nginx warning that header values with underscore are dropped by default
* Unused models/schemas
* Use of properties with oneOf, which is ambiguous in OpenAPI Specification
I've allowed for disabling recommendations via System properties, since this is
something that has been requested a few times by users. System properties in this
commit include:
* openapi.generator.rule.recommendations=false
- Allows for disabling recommendations completely. This wouldn't include all warnings
and errors, only those we deem to be suggestions
* openapi.generator.rule.apache-nginx-underscore=false
- Allows for disabling the Apache/Nginx warning when header names have underscore
- This is a legacy CGI configuration, and doesn't affect all web servers
* openapi.generator.rule.oneof-properties-ambiguity=false
- We support this functionality, but the specification may not intend for it
- This is more to reduce noise
* openapi.generator.rule.unused-schemas=false
- We will warn when a schema is not referenced outside of Components, which
users have requested to be able to turn off
* openapi.generator.rule.anti-patterns.uri-unexpected-body=false
* Move recommendation/validations to oas package and add javadoc comments
* Refactor and test recommendation validations
* Refactor validation function signatures to return explicit state rather than boolean
* Add operation recommendation for GET/HEAD w/body
* 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.
* Fixes NPE when no outputDir is set
* Fix behaviors of default values for values not provided by user
* Easier handling of default behavior in settings.
* Fixes for dynamic config deserialization (specifically, ruby client sample fix)
* Tests for WorkflowSettings (defaults, modified defaults, nulls)
* Test modification of WorkflowSettings defaults for both class constructor and builder
* Filter deprecated generators from CLI list by default.
* [gradle] Exclude deprecated generators from list by default, add "include" option to allow for customization of list task.
* Update scripts to support the --include option of the list command
* Update gradle/cli docs for generators listing with "include" option.
* [core] Initial support for server variable overrides
* [gradle] Support user overrides for serverVariables
* [core] Clarify server variable overrides, and propagate them to templates in the "servers" array
* Initial implementation of a validation framework in core
* Print surefire summary (helps evaluate errors)
* Bump versions: surefire plugin,jmockit
* Depend on jmockit within maven-surefire-plugin which requires it