8767 Commits

Author SHA1 Message Date
Sebastien Rosset
e9d35c5a2a
[Java-client] Add maven-compiler-plugin in pom.xml and enable linter checks by default (#5866)
* Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default

* Add maven-compiler-plugin plugin in Java pom.xml and enable linter checks by default
2020-04-11 00:40:27 +08:00
William Cheng
b7dfd3b2a7
consolidate header selection functions (#5889) 2020-04-11 00:39:33 +08:00
William Cheng
59c3a3127b
[PS] add file post-processing to the PowerShell generator (#5864)
* add post process to ps generator

* add import

* fix merge issue
2020-04-11 00:30:05 +08:00
William Cheng
5c2d1eafa2
[PS] better handle special variables (#5885)
* add variable

* fix reserved words
2020-04-10 21:46:27 +08:00
Bouillie
d221237309
[Csharp-client] Complex form parameters are not serialized as application/json (#5849)
* [csharp-client] Complex form parameters are now correctly serialized as json.

* Updated csharp samples

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-10 15:09:12 +08:00
William Cheng
6c153bd079
[C#] dependency upgrade (#5870)
* Updating packages version (#5313)

* Add support to RestSharp version 106.10.1

Restsharp 106.10.1 needs the Content Lenght as a parameter to AddFile method

* Updating RestSharp Version

Updating RestSharp Version

* Update netcore_project.mustache

* Update netcore_testproject.mustache

* Update Project.mustache

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Updating packages version

Updating packages version

* Execute task async obsolete

Use ExecuteAsync instead

* update csharp samples

Co-authored-by: William Cheng <wing328hk@gmail.com>

* [csharp] Library upgrade fix (#5848)

* On .net45 framework, Restsharp version is updated to 106.10.1 Otherwise, it stays on version 105.1.0

* Added additionalProperties for library versions and target frameworks

* Removed unused properties

* Added an additional property to test for a specific version of RestSharp

* Updated csharp samples

* Fixed nuspec.mustache to use library specific additional properties

* Updated csharp samples

* Updating CI/samples.ci csharp petstore test project file.

* Updated csharp.md

Co-authored-by: Olivier Leonard <oleonard@ankama.com>

* [csharp-client] Restored tests on csharp samples (#5879)

* Restored tests on csharp samples

* Restored a reference to the file used to test file uploads

Co-authored-by: Olivier Leonard <oleonard@ankama.com>

* update samples

Co-authored-by: Igor Quirino <iquirino91@gmail.com>
Co-authored-by: Bouillie <34162532+Bouillie@users.noreply.github.com>
Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-10 15:08:34 +08:00
William Cheng
46f3b4a870
various enhancement to ps exp generator (#5875) 2020-04-09 22:28:58 +08:00
William Cheng
7342077cb1
[PS] Select Content-Type in the response (#5872)
* better return type handling

* update tempalte

* better documentation

* fix greater than
2020-04-09 20:06:26 +08:00
sunn
c73f3c5eb2
Updates to allow the setting of the dateTime format string (#5763) 2020-04-09 09:20:35 +02:00
William Cheng
d599527104
[PS][Experimental] Add validations to model (#5842)
* add validations to model

* better error message

* improve validation
2020-04-09 10:49:37 +08:00
William Cheng
31ecf7306b
stop error globally (#5858) 2020-04-08 21:53:51 +08:00
Jacob Floyd
469b21830c
Add pythonSrcRoot option to python servers (aiohttp/flask/blueplanet) to support src/ layout projects [and reenable/fix all python server tests] (#5423)
* python server: Add pythonSrcRoot option

This will allow the python project to be in a subdirectory (as specified
in pythonSrcRoot). That could mean following the src layout with sources
under src/ or lib/. Multi-language projects might use a sub directory
like python/, or whatever makes sense for the project.

By default, the pythonSrcRoot is "", meaning the existing behavior is
the default.

* python server: update template files to support pythonSrcRoot

* python server: update docs to add pythonSrcRoot option

* python server: add pythonSrcRoot sample script

* python server: build sample srclayout project

* [Python] copy test files preserving history

* [Python] Make a conflict to preserve file copy history

* [Python] customize pom.xml for src layout tests

* [Python] add python-aiohttp-srclayout tests

* [Python] Fix server tests by updating requirements

Reverts the PR that disabled python2 server tests:
https://github.com/OpenAPITools/openapi-generator/pull/4949

Reverts commits that disabled python3 server tests:
9adfedbfbb45c7059e64b3d9a285710bded4fb62
17ee990baaa80585242c7a07d64e2be4888fcfd0

Issue about the python 3 tests:
https://github.com/OpenAPITools/openapi-generator/issues/5235

I couldn't find an issue about the python2 tests being disabled.
I'm guessing build errors like the following were the trigger:
https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/634238181

Let's see what breaks!

* [Python] Copy setup.py to python-aiohttp

* [Python] Save history while copying setup.py to python-aiohttp

* [Python] Add aiohttp server setup.py

* [Python] Fix python server tests with src layout

* [Python] bump Flask-Testing version

* [Python] Pin pyyaml for py2.7 flask server

* [Python] simplify flask server requirements

* consolidate server tests

* [Python] rebuild python server samples

* [Python] Fix python server requirements for older pythons

Documented minimum python version for our aiohttp server is 3.5.
Documented minimum python version for our flask server is 3.4.
Connexion 2.3 is the last version to support python 3.4 and 3.5, so fix
the version pinning to correctly select <=2.3 for these EOL python
versions. Newer pythons should get the latest if possible as there many
relevant bug fixes.

Werkzeug also needs to be pinned for these old versions in the aiohttp
server just like for the flask server.

3.4 and 3.5 are EOL. We really should increase the minimum supported
version, but that is for another PR to do.
2020-04-07 23:14:13 -07:00
William Cheng
41955b104c
add parent for allOf only (#5851) 2020-04-08 11:04:13 +08:00
emileonhardt
55f928a82e
Fix for Issue #4840 [BUG][JAVA][spring-mvc] Generated Code for Map of Maps Return Type does not compile (#5240) 2020-04-07 22:32:09 +08:00
William Cheng
22f3e59210
Add default case to handle response code (#5825)
* add default case to handle response code

* fix default response code

* add test for isDefault
2020-04-07 16:48:36 +08:00
jburgess
2ff9be6f95
[codegen] Fix 'super.HashCode' for oneOf and allOf Implementations (retry) (#5830)
* Added hasVars after completion of all model post-processing (#5587)

* Post ensure-up-to-date

* Update to check the size of vars and not assume non-null
2020-04-07 16:42:20 +08:00
Nicholas Muesch
7efa65164a
Add openapi.yaml file to Java clients (#5765)
* Add openapi.yaml file to Java client

* Move supporting template file to Java root

* Update petstore clients
2020-04-07 16:07:08 +08:00
Michele Albano
5fd724fceb
C client generator improvements to support petstore. Solves #5836 (#5837)
* C client generator improvement to support:
openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml

* Improvements to the C client generator:
- moved base64* from apiClient.c to binary.h/binary.c
- changed CR/LF to LF in binary.h/binary.c

* C client generator: better support for base64encode / base64decode
2020-04-07 11:40:57 +08:00
Bouillie
6cdfb7ca9f
Scala akka http server - normalization of some vendor extensions (#5829)
* [scala-akka-http-server] Normalized vendor extension "paths" to "x-paths"

* [scala-akka-http-server] Normalized vendor extension "hasDefaultValue", "isDefault", "specificMarshallers", "fileParams", "nonFileParams"

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-07 01:00:48 +08:00
William Cheng
5dd572035c
minor fix to http basic auth (#5839) 2020-04-06 16:07:36 +08:00
Natan Laverde
6cbc442b02
[C++] [Qt5] [Client] fixed cpp-client-qt5 HttpRequestWorker contentCompression variables initialization (#5834)
When contentCompression is not enabled, the variables isRequestCompressionEnabled and isResponseCompressionEnabled in HttpRequestWorker are not being initialized.
Without initialization the compress function could be called and the request content could be an empty QByteArray instead of original request body.
2020-04-06 08:53:41 +02:00
William Cheng
f1325e23ee
support enum in parameters (#5838) 2020-04-06 14:45:45 +08:00
William Cheng
d893ee883b
use allVars to cover all properties (#5835) 2020-04-06 10:54:49 +08:00
Richard Whitehouse
cdb500c156
[Rust Server] Fix no features build (#5747)
* Remove test file erroneously checked in

* [Rust Server] Fix no features build

- Need serde_json for no-features build for undefined value structures
- Don't include `IntoHeader` type and implementations if we aren't including the client/server features
- Don't export the `IntoHeader` type at all - it's internal

* Update samples
2020-04-05 19:08:39 +01:00
Michele Albano
e9c1346386
tests for models for C-libcurl generator (#5699)
* First try to generate unit tests for the models of the C-libcurl client. Models into models are not supported yet.

* Added unit tests for the modules of the C-libcurl client to the git repository.

* Support for objects having other objects as properties, for the C-libcurl client generator

* Proper formatting of generated code
2020-04-06 01:42:50 +08:00
Alex Buchkovsky
166aae6fec
[BUG] [KOTLIN] Fix default value generation for Kotlin Strings (#5776)
* fix default value generation for kotlin

* add updated pet templates

* Revert "add updated pet templates"

This reverts commit 7e8168ad

* regen pet store projects code
2020-04-06 01:30:03 +08:00
Antoine Reilles
3b495bab12
[jaxrs-cxf-cdi] fix allOf equals and hashCode (#5756)
When generating model that use allOf, the equals and hashCode methods
must take the parent class into account.
2020-04-06 00:26:02 +08:00
William Cheng
52018c43ba
Minor improvements to scala akka server (#5823)
* minor improvements to scala akka server

* add samples

* update doc
2020-04-05 10:09:31 +08:00
Bouillie
af85fab52b
Scala akka-http server (#5758)
* Scala akka-http server base implementation

* [scala-akka-http-server] petStore samples

* Improved the formatting of generated files

* Updated scala-akka-http server samples

* [scala-akka-http-server] the groupId, artifactId and artifactVersion default value are used as intended.

* Fixed the default operation not being correctly generated on parameterless operations

* Added build.sbt.mustache supporting file

* Updated scala-akka-http server samples

* ScalaAkkaHttpServer: Fixed a String.format call to use Locale.ROOT for locale

* [scala-akka-http-server] Fixed defaultValue being escaped during generation

* Added scala-akka-http.md

* Replaced all "⇒" character with "=>" to retain compatibility with scala 2.13

* [scala-akka-http] Added a config option akkaHttpVersion
It's set in the generated build.sbt.

* Updated scala-akka-http server samples

* [scala-akka-http] More accurate akkaHttpVersion parsing

* Updated scala-akka-http.md

* [scala-akka-http] Changed the akka-http version check to fix the generation of StringDirectives

* Updated scala-akka-http samples

* updated scala-akka-http.md

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-04 23:16:14 +08:00
William Cheng
00ec8fd15b
fix array return (#5822) 2020-04-04 21:49:40 +08:00
William Cheng
42e87c8f33
rename hostsetting, validate base url (#5821) 2020-04-04 17:25:05 +08:00
Sebastien Rosset
242c2e8544
[Python-experimental] Documentation enhancement for oneOf schema and minor err msg improvement (#5791)
* Add documentation to generated code

* Improve error message

* Improve documentation

* Improve documentation

* Improve documentation

* Improve documentation

* Improve documentation

* Improve documentation

* Run sample scripts

* Address review comments

* Address review comments

* Fix problem in python error message
2020-04-03 20:49:23 -07:00
Sebastien Rosset
acae76b38f
[codegen] Cachesize config seconds (#5816)
* make name cache configurable

* Address review comments
2020-04-03 17:15:55 -04:00
Sebastien Rosset
3d99c58338
make name cache configurabl (#5775) 2020-04-03 23:11:48 +08:00
Sebastien Rosset
9c8fb9db46
[codegen] Use once(LOGGER) to reduce amount of identical warning messages (#5808)
* Warn once instead of many times when the log statement does not have contextual information

* Warn once instead of many times when the log statement does not have contextual information
2020-04-03 23:10:12 +08:00
William Cheng
281d154ff4
[PS][Experimental] add withHttpInfo support, fix "null" return (#5811)
* add with http support

* use full name in tests

* using full name in test

* skip type check
2020-04-03 15:47:04 +08:00
William Cheng
bc12ada4c0
use write verbose in auth, better api doc (#5804) 2020-04-03 10:14:06 +08:00
tanmen
7d35268414
[typescript-axios][client] Unnecessary imports occurs when using withSeparateModelsAndApi (#5797)
* add ts-ignore

* add petstore sample
2020-04-02 19:17:40 +02:00
Aleksandr Nekrasov
ea2fd0f1b6
fix scala-akka java8 serializers (#5742)
* fix scala-akka java8 serializers

* regenerate samples for akka-http
2020-04-02 12:18:21 +08:00
Bouillie
65eff3ba4c
[Csharp-client] Complex form parameters are not serialized as application/json (#5787)
* [csharp-client] Complex form parameters are now correctly serialized as json.
Reference: http://spec.openapis.org/oas/v3.0.3#special-considerations-for-multipart-content

* Updated bin/windows csharp sample generation scripts to point to the correct directories

* Updated csharp samples

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-02 11:59:27 +08:00
Slavek Kabrda
3f445772ae
[go-experimental][go][client] Remove unreachable code in go client API methods (#5611)
* [go-experimental][go][client] Remove unreachable code in go client API methods

* Properly regenerate all samples
2020-04-02 11:15:31 +08:00
Josh Burton
04160dab3d
[dart-dio] Fixes --model-name-suffix having no effect (#5669)
Fixes #5409
2020-04-02 11:13:23 +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
Jim Schubert
e14e5fccf3
[cli][docker] Better expose version/sha information of builds (#5736)
* [cli] Some CLI improvements…

* Introduce --version
* Introduce --help
* Add --sha to version command for short SHA display
* Output Version and SHA details
* In new --version output, display repo and doc site

Additional cleanup to suppress warnings and code quality.

* [docker] Adds labels for metadata

This adds image labels to store metadata on the online and cli docker
images, using standard labels:

* org.opencontainers.image.created
* org.opencontainers.image.revision
* org.opencontainers.image.title
* org.opencontainers.image.version

These can be inspected via 'docker inspect IMAGE_NAME' and may be useful
in tooling/automation or bug reports submitted by users.

For more details on these labels, see:
https://github.com/opencontainers/image-spec/blob/master/annotations.md

* Include version --full for equiv to --version
2020-04-02 11:05:25 +08:00
William Cheng
4623ec86d3
[PS][Experimental] Better common verb handling (#5783)
* better common verb handling

* better debugging

* add option to customize common verb
2020-04-02 08:19:16 +08:00
William Cheng
12440ca877
add map example (#5778) 2020-04-01 14:59:33 +08:00
William Cheng
f58ebf65d1
use Initialize instead of prepare (#5777) 2020-04-01 11:21:11 +08:00
William Cheng
24513091b0
use prepare instead of new (#5773) 2020-04-01 09:24:07 +08:00
Timur Platonov
01d07694fb
fix request.on_complete message when tempfile is nil (#5745)
* fix request.on_complete message when tempfile is nil

* update faraday client sample

* add openapi3 client samples
2020-04-01 00:10:31 +08:00
William Cheng
0fd5d46585
add support for common verbs (#5771) 2020-03-31 22:37:30 +08:00