8767 Commits

Author SHA1 Message Date
Jason Lee
8ff1aca4f8 fix when unhandledException=false does not take effect (#4543) 2019-11-20 10:11:02 +08:00
Emanuel Borsboom
6e2e542f83 [Rust] Derive more traits (#4142)
* Simple enums: add: Clone, Copy, Eq, Ord, PartialOrd, Hash
* Structs and complex enums: add `Clone`
2019-11-19 16:15:23 +08:00
Matt Traynham
518c33a209 4171 - Correct parent variables being duplicated in child (#4253) 2019-11-19 15:35:24 +08:00
Massimo Siani
964260101b [kotlin-spring] add support for the delegate pattern (#3925)
* #2526 support the delegate pattern for kotlin-spring

* fix the diamond

* update the doc

* fix ci

* use Resource? instead of MultipartFile when dealing with files

* bump after rebase on master
2019-11-19 15:22:29 +08:00
William Cheng
2daa89a326
Better else clause with warnings (#4507)
* better else clause to catch exception

* use warning instead
2019-11-18 21:49:15 +08:00
Jim Schubert
8766531c56 [java] Fix java version defaulting (#4520)
* [java] Improve assumptions about artifactVersion

The logic to apply a default artifactVersion was faulty, resulting in
generation without an explicit version specified either on the OpenAPI
Document or at the CLI/plugin level would result in poms generated with

    <version></version>

As an example, in any commit made up to 5 weeks before this commit, run:

    ./bin/java-pkmst-petstore-server.sh

The solution is to ensure that artifactVersion isn't overwritten by an
"in-process" additonalProperties map, and also to ensure that
additionalProperties is synced with the artifactVersion property once it
has been modified.

As a future task, we'll want to move any modification of
additionalProperties outside of preprocessOpenAPI (to processOpts).
We're hiding manipulation of the "Opts" at a point where we should
really only be applying logic on top of the OpenAPI doc.

* [sample] Regenerate java-pkmst sample
2019-11-18 11:32:54 +08:00
Jim Schubert
10f17877f1
Fixes issues with Scalaz outputs (#4508)
Scalaz is not re-generated by users or CI (only verified), so some
compilation issues have been introduced into the generator.
Specifically, the generator previously didn't handle defaults well (or
even correctly, maybe?). This broke when array models were added to the
openapi document used to generate samples. The inclusion of Date-related
mappings being mapped to joda time in DefaultCodegen also caused some
issues with new DateTime properties on models.

Over the course of what appears to be Nov 10-17 2019, CircleCI seems to
be having intermittent issues with Scalaz verification. I found that
green builds were picking up SBT 0.13.x and failed builds were SBT
1.1.0. It's not clear where the system level SBT is being defined, but a
simple fix has been to enforce the sbt version in the generator.

For those unfamiliar with SBT; the SBT command acts as a launcher script
which may switch to older/newer versions of SBT. A Scala project invoked
with SBT 1.1.0 will look for an sbt.version override and happily attempt
compilation with the available SBT 1.1.0. The problem is that SBT 1.1.0
uses Scala 2.12 and this is not binary compatible with Scala 2.11. This
can cause issues with builds due to plugins or incompatible Java version.
2019-11-17 09:18:57 -05:00
William Cheng
2f428e7763 minor fix to CI failure 2019-11-17 10:43:38 +08:00
amond
78d7ffbce7 feat(dart-dio): correctly handle Map<String, Object>, List<Object> using JsonObject (#4401)
* feat(dart-dio): correctly handle Map<String, Object>, List<Object> using JsonObject

Signed-off-by: Minsu Lee <amond@amond.net>

* feat(dart-dio): correctly handle Map<String, Object>, List<Object> using JsonObject

Signed-off-by: Minsu Lee <amond@amond.net>
2019-11-17 09:39:55 +08:00
Justin Black
d175673077 [OCAML] Fixes cloud.drone.io ocaml-test (#4501)
* Fixes ocaml-test

* Ocaml readme update
2019-11-17 09:23:15 +08:00
Erik Timmers
3cd0e13a46 [elm] Add support for oneOf (#4434)
And add additional test for composable types.
2019-11-17 09:18:26 +08:00
Jorge Rodriguez
60958b78d9 [BUG] [Java] Client resttemplate and webclient. Form Params are badly added when they are lists (#4461)
* 4383: Client resttemplate and webclient. Form Params are badly added when they are lists

* 4383: Force redeploy

* 4383: Fix test

* 4383: Fix map

* 4383: revert change

* 4383: Fix test resttemplate-withXml
2019-11-17 09:01:40 +08:00
Jan
5181ddcbb0 fix: prevent ClassCastException when handling options of (issue #4468) (#4495)
* issue 4468 fix: prevent ClassCastException when handling options of type boolean

*  #4468 fix: remove duplicate code
2019-11-17 08:59:25 +08:00
Justin Black
a1a9e70fe4 Fixes Python client Configuration class so each instance uses its own dicts (#4485) 2019-11-17 08:49:19 +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
Rob Oxspring
b43785a25c DartClientCodegen reads dart-keywords.txt as resource, not file (#4484) 2019-11-14 23:59:53 +08:00
Erik Timmers
6c714ddca9 [typescript-fetch] Add (de)serializers for oneOfs (#4387) 2019-11-14 12:21:06 +01:00
djairhogeuens
d9e93ce6ca feature: Typescript-angular support single request param (#4479)
* adds support for useSingleRequestParameter for typescript angular generator

* updates samples

* removes tab

* updates documentation

* removes tabs

* Revert "updates samples"

This reverts commit 8c5bfd94bdbd52187c1f38c43292dbba2cc483ef.

* updates samples

* adds configuration for sample generation

* fixes script

* sets executable flag

* fix docs
2019-11-14 10:51:37 +01:00
Bruno Coelho
fe0b3ce24d [kotlin][client] improve nonpublic api (#4478) 2019-11-14 16:19:08 +08:00
Min Kim
287af4aba3 recursive equal on reflection (#4475) 2019-11-14 13:09:23 +08:00
Rob Deutsch
64c1547c5d typescript-fetch: Only generate npm package if npmName specified (#4472)
* Only generate npm package if npmName specified

* additionalProperties not available in constructor
2019-11-13 07:37:21 +01:00
William Cheng
fa1e003a3b
minor enhancement to c client generaotr (#4457) 2019-11-13 13:34:31 +08:00
Eric Feliksik
440e3f301d Re-interrupt the thread in the generated code (#4382)
* Re-interrupt the thread in the generated code, otherwise the client has to check for
the type of the cause of the thrown exception.

* update samples
2019-11-13 13:28:50 +08:00
Alexander Eggers
34c715e4ce [Kotlin][Client] Add option to make all api method return a nullable model (#4422)
* Added new additional parameter to allow nullable api return types

* Tweaking samples and .bat files

I've added new .bat files for the kotlin-client to alllow windows-devs to re-generate required samples via windows-shell (for CI).
2019-11-12 22:15:54 -05:00
Yurii Zhoholiev
4494bf1e9a [csharp-netcore] Propagate raw content to the ApiException error content. (#4381)
* [csharp-netcore] Propagate raw content to the ApiException error content.
2019-11-12 15:58:38 -05:00
Sébastien Masset
99204ecd66 Avoid generating uncompilable response body in Spring's API template (#2903)
* Moved example string to a dedicated variable in Spring's methodBody template

* Created a new exampleString template for JavaSpring

* Added a new mustache lambda to trim whitespace in fragments

* Added a new lambda to split long fragments into compilable strings

* Use newly introduced lambdas in Spring's API template to avoid generating uncompilable example code
2019-11-12 17:49:05 +08:00
Martin Delille
21a291f569 cpp-qt5-client: remove host since it is not well handled (#4429)
* fixup! Simpler timeout with QTimer::singleShot (#4430)

* cpp-qt5-client: remove host since it is not well handled

* Move disconnect again

* cpp-qt5-client: handle scheme/host/port properly

* Fix port change try
2019-11-12 09:39:31 +01:00
atsharp
9ceabc760c [Java] Refactor webClient generator to use URI templates to capture correct metrics (#4314)
* Fixing URI templating for webclients to support Spring metric collection

* Revert accidental change to test
2019-11-12 16:17:38 +08:00
Jorge Rodriguez
94b58634a7 [Java]: Client resttemplate and webclient: array parameters of type integer in path badly generated (#4379)
* 4375: Client resttemplate and webclient: array parameters of type integer in path badly generated

* 4375: Fix samples

* 4375: Fix samples

* 4375: Fix samples
2019-11-12 16:15:34 +08:00
Nick Meinhold
11bcb661a1 Dart generate keywords (#4449)
* Add script to use Dart SDK to generate keywords

* Read generated keywords in dart generator
2019-11-12 00:11:43 +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
84d3562a0f
[Kotlin][Client] minor improvements (#4419)
* minor improvement to kotlin generator

* minor code format change
2019-11-11 16:36:07 +08:00
Anton Nesterov
0aa1b7c7a8 [typescript-rxjs]: Add support for nullable (#4438) 2019-11-11 07:41:24 +01:00
Man
dbbe2b8b2d [asciidoc] fix names of parameters (#4440)
Fixes #4408 

* fix header hierarchy in model section
* small fix markup on dataformat enum (italic)
* fixes parameter names casing
2019-11-10 16:11:55 -05:00
Martin Delille
7e6e87a857 fixup! Simpler timeout with QTimer::singleShot (#4430) (#4435)
* fixup! Simpler timeout with QTimer::singleShot (#4430)

* Move disconnect again

* Fix self assignement in HttpRequest.cpp.mustache
2019-11-10 17:05:22 +01:00
Martin Delille
d0b2465b89 Simpler timeout with QTimer::singleShot (#4430) 2019-11-10 11:40:11 +01:00
Martin Delille
3e87a5fbaf cpp qt5 client: fix prefix bug (#4432) 2019-11-10 09:44:45 +01:00
Jim Schubert
357f6caed5
[meta] Support Kotlin meta generator (#4156)
* [meta] Support Kotlin meta generator

* Guard against automatic scripts (assumptions for this script are not fulfilled by some CI which run "run all" type scripts)
2019-11-09 10:47:55 -05:00
William Cheng
db729be7df
[Go][Server] minor enhancement to the template (#4417)
* minor enhancement to the go server template

* update samples
2019-11-09 11:24:12 +08:00
Dennis Melzer
777e39007a Replace the old ResourceSupport (#4426)
#4425
2019-11-09 11:00:51 +08:00
Richard Whitehouse
de162f7f34
[Core, Rust Server, ASP.NET Core] Fix Codegen Operation Scope Consistency (#3495)
Fix Codegen Operation Scope Consistency

- Filter scopes based on operation

- Partially revert #1984 to not rely on custom attributes as to whether scopes exist

- Fix filtering global authentication schemes
2019-11-08 13:30:35 +00:00
Jesse Michael
5b4441892f Add Go Server featureCORS option (#4400)
Add a Go server configuration option of "featureCORS" that defaults to false. When set to true the Go server routers will be generated with Cross-Origin Resource Sharing middleware through gorrilla mux.

https://www.gorillatoolkit.org/pkg/handlers#CORS
2019-11-08 15:35:27 +08:00
Joel Beach
79d7e61b87 Fix treatment of nullable types in a few more places (#4315) 2019-11-08 08:06:11 +01:00
William Cheng
05e954c8aa
prefix local variable with localVar (#4402) 2019-11-08 15:04:33 +08:00
Bruno Coelho
7cf027fbf5 [kotlin][client] gson complete integration (#4332)
* [kotlin] update dependencies

* [kotlin][client] complete gson integration

* [kotlin][client] run petstores

* [kotlin][client] fix JsonMediaType and update petstores

* Add kotlin client gson to pom.xml

* Remove org.json dependency

* Try to fix kotlin-gson build

* Add kotlin client nonpublic to pom.xml

* Update samples

* try to fix build

* try to fix build

* try to fix build

* try to fix build

* [kotlin][client] restore libraries version

* [kotlin][client] update kotlin version

* [kotlin][client] update some libraries versions

* [kotlin][client] update some libraries versions

* [kotlin][client] add kotlin-gson and kotlin-nonpublic to CI test suit

* [kotlin][client] update some libraries versions

* try to fix build

* try to fix build
2019-11-08 15:02:48 +08:00
Jan
f9af3c2752 [kotlin] [bugfix] [maven-plugin]: prevent ClassCastException with boolean config options (#4361)
* fix: prevent classcast exception during execution of openapi-generator-maven-plugin.

* style: revert styling to openapi defaults

* test: unit test coverage for handling boolean config options

* fix: replace option value with boolean, if it is a string literal boolean

* style: use data type long

* test: add maven testfile kotlin.xml to travis build

* test: runnable maven test of the kotlin generator
2019-11-08 14:38:05 +08:00
sunn
048fe29226
Update isSet when the object is received from callback. (#4385) 2019-11-07 16:55:02 +01:00
Martin Slemr
f0bcaaf45d Ruby client nullable (#4391)
* Ruby Client: implementation of nullable

* Ruby samples with nullable implementation

* [Ruby] openapi_nullable as a Set and skipping attrs fix
2019-11-07 16:15:00 +08:00
Mathieu Lemoine
9a1ff9bf05 Fixes Kotlin client property names that include a dollar sign for template override (#4351)
Fixes #4228
2019-11-07 14:14:13 +08:00