66 Commits

Author SHA1 Message Date
Pierre-Yves FARE
3de587826a
Remove extra bracket in --http-user-agent example. (#6247) 2020-05-11 14:30:20 +08:00
William Cheng
8fa76843d0 resolve merge conflicts in the core generator files 2020-04-17 16:10:10 +08:00
William Cheng
faf6f197be Merge remote-tracking branch 'origin/master' into 5.0-sync-master 2020-04-17 15:51:00 +08:00
Jim Schubert
2957dd4d45
[cli] Add --global-property for -D replacement (#5687)
-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.
2020-04-02 11:11:02 +08:00
William Cheng
a0ca253218
update samples (#5722) 2020-03-27 13:55:55 +08:00
William Cheng
c224cf484b
4.3.0 release (#5721) 2020-03-27 11:34:43 +08:00
Jim Schubert
ef008549b3
[handlebars] Honor supporting files when applying bundles (#5364)
* [handlebars] Honor supporting files when applying bundles
2020-02-23 16:59:37 -05:00
William Cheng
100b01844a Merge remote-tracking branch 'origin/master' into 5.0.x 2020-02-04 15:31:10 +08:00
Jim Schubert
a496c2011f
[docs] Initial FeatureSet generator documentation (#5188)
* 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
2020-02-01 20:51:55 -05:00
Jim Schubert
507f80617d
[bug] Templates via classpath (#5164)
* 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
2020-01-31 17:36:06 -05:00
Jim Schubert
22c6c0ca68
[core] Extracting recommendations to validation framework (#4979)
* [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
2020-01-31 12:19:16 -05:00
William Cheng
03a59046f4 Merge remote-tracking branch 'origin/4.3.x' 2020-01-31 19:00:28 +08:00
William Cheng
26ace1337d
Prepare 4.2.3 release (#5172)
* release 4.2.3

* update readme
2020-01-31 16:24:06 +08:00
Jim Schubert
c0f7b47292
[ci][test] Modifications to static analysis contribution via Tomasbjerre (#5116)
* 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>
2020-01-26 12:45:41 -05:00
William Cheng
82e2448bf2 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2020-01-20 15:46:13 +08:00
William Cheng
04af5e0445 Merge remote-tracking branch 'origin/master' into 4.3.x 2020-01-20 15:04:34 +08:00
Jim Schubert
ea55968737
Evaluating https issues in CircleCI (on top of CiscoM31-maven-h… (#5034)
* replace http with https. Replace http://central.maven.org with https://repo1.maven.org

* replace http://www.apache.org/licenses/LICENSE-2.0 with https://www.apache.org/licenses/LICENSE-2.0

* Force HTTPS for mavenCentral gradle DSL

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2020-01-18 18:53:05 -05:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions (#3614)
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:

*  ada 
*  android 
*  apache2 
*  asciidoc 
*  aspnetcore 
*  avro 
*  bash 
*  c 
*  clojure 
*  cpp-pistache-server 
*  cpp-qt5-client 
*  cpp-qt5-qhttpengine-server 
*  cpp-restbed-server 
*  cpp-restsdk 
*  cpp-tizen 
*  csharp 
*  csharp-nancyfx 
*  csharp-netcore 
*  cwiki 
*  dart 
*  eiffel 
*  elixir 
*  elm 
*  erlang 
*  flash 
*  fsharp-functions 
*  go  Client/Server
*  graphql-nodejs-express-server 
*  graphql-schema 
*  groovy 
*  haskell 
*  haskell-http-client 
*  java 
*  jmeter 
*  kotlin 
*  kotlin vertx 
*  kotlin-server 
*  kotlin-spring 
*  lua 
*  mysql 
*  nim 
*  nodejs 
*  nodejs-express 
*  objc 
*  ocaml 
*  openapi 
*  openapi-yaml 
*  perl 
*  php 
*  php-laravel 
*  php-lumen 
*  php-silex 
*  php-slim 
*  php-symfony 
*  php-ze-ph 
*  powershell 
*  protobuf 
*  protobuf-schema 
*  python 
*  python-aiohttp 
*  python-blueplanet 
*  python-experimental 
*  r 
*  ror 
*  ruby 
*  ruby 
*  ruby-sinatra 
*  rust 
*  scala-akka 
*  scala-finch 
*  scala-gatling 
*  scala-http-client 
*  scala-lagom 
*  scala-play 
*  scalatra 
*  scalaz 
*  spring 
*  static docs 
*  swift 
*  typescript
2020-01-11 16:20:47 -05:00
William Cheng
11c7007429
Prepare v4.2.3 (#4663)
* update version

* update doc

* update samples
2019-12-02 15:26:01 +08:00
William Cheng
f9662e0eff
release 4.2.2 (#4661) 2019-12-02 13:12:10 +08:00
William Cheng
facabd4472 Merge branch '4.3.x' into 5.0.x 2019-11-21 15:19:31 +08:00
William Cheng
60f4de0f22 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-11-20 18:15:22 +08:00
William Cheng
f07b3e0521
Prepare 4.2.2-SNAPSHOT (#4497)
* update to 4.2.2-SNAPSHOT

* update doc

* update samples

* skip ocaml test

* update version

* fix version
2019-11-15 21:34:25 +08:00
William Cheng
2683dd4510
Prepare 4.2.1 release (#4494)
* prepare 4.2.1 release

* use stable version in test/example
2019-11-15 16:07:03 +08:00
Jim Schubert
7bfc53b3bb
[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.
2019-11-11 08:03:13 -05:00
William Cheng
4824bb7711 sync master, update samples 2019-11-04 09:28:19 +08:00
William Cheng
47e2c0d027
update samples (#4334) 2019-10-31 13:31:49 +08:00
William Cheng
34070bd151
Prepare 4.2.0 release (#4333)
* remove snapshot

* update doc
2019-10-31 11:36:53 +08:00
William Cheng
8f86f0f04a Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-10-08 21:21:04 +08:00
William Cheng
d4500b307f Merge remote-tracking branch 'origin/master' into 4.2.x 2019-10-04 15:02:58 +08:00
William Cheng
f955966b09
prepare 4.1.3 release (#4052) 2019-10-04 13:46:07 +08:00
bgong-mdsol
ebc9e291c3 Feature/api name suffix (#3918)
* added apiNameSuffix parameter to control the suffixes of API class/file/doc names

* added --api-name-suffix in readme
2019-10-03 09:51:06 +08:00
William Cheng
5eb67d471b Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-09-22 21:00:38 +08:00
William Cheng
3019b5a5e1 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-09-22 14:18:07 +08:00
William Cheng
ea029b4029
update doc, samples (#3875) 2019-09-11 21:17:11 +08:00
William Cheng
3ebefccfa9
Prepare v4.1.2 release (#3873)
* update samples

* update date
2019-09-11 18:33:27 +08:00
Quim Muntal
8f13b88ed9 Support custom git repository (#3757)
* add gitHost param to GeneratorSettings and related

* parameterize gitHost in READMEs

* parameterize gitHost in go.mod

* parameterize gitHost in git_push

* update petstore samples

* run ./bin/utils/export_docs_generators.sh

* run meta-codehen.sh

* Revert "run meta-codehen.sh"

This reverts commit d6d579f6159186531257cdfdd73b9caf9e9ffeba.

* Revert "run ./bin/utils/export_docs_generators.sh"

This reverts commit 1b81538198d4319fd1b4e97447303e3cc0e8dc99.

* Revert "update petstore samples"

This reverts commit f513add88396707f6991ae2e4920359583ec88f1.

* run ensure-up-to-date
2019-09-03 21:35:49 +08:00
William Cheng
a8fe5d355c Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-08-29 14:48:00 +08:00
William Cheng
9182784955 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-08-28 14:01:20 +08:00
William Cheng
d0d545bbdd
Prepare 4.1.2 snapshot (#3758)
* update pom

* update samples

* update ts axios samples
2019-08-26 22:13:12 +08:00
William Cheng
197294a167
Prepare 4.1.1 release (#3756)
* 4.1.1 release

* update doc
2019-08-26 15:59:33 +08:00
Jim Schubert
ee7c8a82e8
[BUG][CLI][GENERATOR] NullPointer when not setting outputDir (updated) (#3752)
* 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
2019-08-25 19:19:52 -04:00
Jim Schubert
a5349cfde5
[cli][gradle] filter deprecated generators by default when listing available generators (#3612)
* 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.
2019-08-12 08:25:52 -04:00
Jim Schubert
06533b977c
[core][gradle] User-defined server variable substitutions (#3363)
* [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
2019-08-11 09:57:36 -04:00
William Cheng
01222268e8 update samples 2019-08-11 18:56:47 +08:00
William Cheng
5956569e7a
Prepare 4.1.1-SNAPSHOT (#3603)
* update pom

* update samples

* update pom
2019-08-10 09:41:08 +08:00
William Cheng
59c4e381d1
Prepare 4.1.0 release (#3597)
* update pom

* update doc

* update version

* add dep for nullable annotaiton
2019-08-09 22:25:32 +08:00
wing328
a48d7f77fb Merge remote-tracking branch 'origin/4.1.x' into sync_41x_50x 2019-06-27 18:27:20 +08:00
wing328
7534df4520 Merge remote-tracking branch 'origin/master' into 4.1.x 2019-06-26 16:01:23 +08:00
Jim Schubert
3ee76a0662
[core] Initial implementation of a validation framework in core (#3183)
* 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
2019-06-24 18:24:50 -04:00