9299 Commits

Author SHA1 Message Date
William Cheng
a8620b8663
add bearer support to csharp client (#5975) 2020-04-19 10:46:34 +08:00
Fabian Freund
e47739dda5
return a null instead of application/json when no content types are set (#5941)
* return a null instead of application/json when no content types are set

* update petstore sample

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-18 09:57:18 +08:00
Bouillie
cb50ad590f
[scala-akka-http-server] Fix a generation problem on operations with empty responses (#5868)
* [scala-akka-http-server] When expecting an empty response, a response with an empty text/plain content is not produced anymore

* Updated scala-akka-http-server samples

Co-authored-by: Olivier Leonard <oleonard@ankama.com>
2020-04-18 01:22:24 +08:00
Ghufz
0adc20f114
[powershell-experimental] ValidatePattern with double-quote (") throws-exception (#5956)
* ValidatePattern having double quote(") throws exception on running Build.ps1

* fix tab with space

Co-authored-by: Ghufran Zahidi <gzahidi@cisco.com>
2020-04-17 23:08:48 +08:00
William Cheng
faf6f197be Merge remote-tracking branch 'origin/master' into 5.0-sync-master 2020-04-17 15:51:00 +08:00
Bodo Graumann
896867b5e7
Use model as body param for generateAliasAsModel (#4569)
* generateAliasAsModel: Use model name as body param

* Update samples
2020-04-17 13:36:27 +08:00
tanmen
efae171054
[typescript-axios][client] Allow apiKey type Promise. (#5953)
* change apiKey type

* recreate sample
2020-04-16 14:04:43 +02:00
Hui Yu
41664b3ba8
[C][Client]Fix data lost when libcurl write-data callback function is called multiple times (#5828)
* [C][Client]Fix the defect of data lost when libcurl write-data callback function (configured by CURLOPT_WRITEFUNCTION) is called multiple times.

* [C][Client]Fix data lost when libcurl write-data callback function is called multiple times (Reset count)
2020-04-16 12:45:44 +08:00
Tomasz Prus
7a0242311f
[python/asyncio] fix passing proxy parameters to aiohttp (#5943) 2020-04-15 18:16:08 -07:00
Sebastien Rosset
91cfabdad2
[Python-experimental] Fix TypeError: unhashable type: 'list' (#5810)
* handle scenario when value is a list, fix TypeError: unhashable type: 'list'

* Add __hash__ function

* use list instead of set

* use list instead of set

* use list instead of set

* use list instead of set

* use list instead of set

* use list instead of set
2020-04-15 17:02:56 -07:00
Sebastien Rosset
827904f732
[Python-experimental] Use DER encoding for ECDSA signatures, add parameter to configure hash algorithm (#5924)
* Use DER encoding for ECDSA signatures

* Use DER encoding for ECDSA signatures

* Use DER encoding for ECDSA signatures

* Use DER encoding for ECDSA signatures

* fix python unit tests for http message signature

* Fix error message

* format python code

* format python code
2020-04-15 10:43:33 -07:00
Andy.Yang.cn
c3837ca331
[Rust Server] Fix #5906 (yaml with path parameter error) (#5871)
* [Rust Server] Fix Rust 1.39+ "Box<Future" and "as &Has" compile issue

* [Rust Server] Fix Rust server side pathRegEx and baseName not match issue

* [Rust Server] Add test case yaml with path parameter.
2020-04-15 17:19:00 +01:00
William Cheng
d57ceb86bf
fix duplicated semi-colon in c# model (#5934) 2020-04-15 16:28:54 +08:00
chandra-gh
8a17ae6822
Update axios dependency to the new minor version 0.19.0 (#5867)
* Update axios dependency to 0.19.0

Axios (version 0.18.0) used by typescript-axios generator is more than two years old (released in Feb 2018). Axios 0.19.2 released earlier this year contains a lot of fixes and functionality, I recommend updating to 0.19.2.

* Ran ./bin/typescript-axios-petstore-all.sh to update package.json in ./samples

Co-authored-by: Chandra Yalangi <chandra.yalangi@appklenz.com>
2020-04-14 18:42:46 +02:00
William Cheng
747cd087b6
update dependency for java client (#5926) 2020-04-14 20:34:16 +08:00
Shinya Sugmoto
533d686bec
[Dart] Remove content type from header when content type is not specified (#5752)
* accept empty content type

* fixed test

* updated samples

* additional comment out
2020-04-14 18:19:34 +08:00
Sebastian
131bd4fd35
Fix for Result Model Name collision (#5923)
* Fix for Result Model Name collision

* Run Scripts

Co-authored-by: Sebastian Ohm <sebastian.ohm@ubimax.com>
2020-04-14 17:23:58 +08:00
Nicolas Homble
c479e518d4
[Python][aiohttp] create venv as rule (#5913)
* create venv as rule

* create venv as rule II
2020-04-14 14:53:28 +08:00
Sebastien Rosset
8af6b7459c
[Java] Discriminator lookup should not be case insensitive by default (#5894)
* Add 'discriminatorCaseSensitive' property

* Discriminator value lookup should not be case insensitive

* fix typo

* run scripts

* execute ./bin/utils/export_docs_generators.sh

* fix discriminator mapping, add code comments
2020-04-13 18:54:00 +08:00
Bruno Coelho
7dd2d3c3eb
[swift5] fix warning (#5900) 2020-04-13 16:57:22 +08:00
Sebastien Rosset
d81c244f9a
[Java] Increase java compiler stack size to handle large files (#5901)
* increase java compiler stack size to handle large files

* increase java compiler stack size to handle large files
2020-04-13 13:56:20 +08:00
Chr1st0ph
cc09118ffc
[Java][Feign] Bug fix in @Param annotation (#5250)
* FIX-5249 fix @Param annotation for Feign-client code generation

Use paramName instead of baseName in order to make mapping in @Headers
section fit the param-value.

* update samples

* FIX-5249 fix @Param annotation for Feign-client code generation

Use paramName instead of baseName in order to make mapping in @Headers
section fit the param-value.

Co-authored-by: Christoph Preißner <christoph.preissner@blu-pa.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-13 09:59:35 +08:00
Richard Whitehouse
95105cef2e
[Rust Server] Support complex query parameters (#5831)
* [Rust Server] Support complex query parameters

* [Rust Server] Remove unused extern crate

* [Rust Server] tokio should be a dev-dependency

* [Rust Server] Add test for complex query params

* Update samples

Co-authored-by: Matt Williams
2020-04-12 19:57:50 +01:00
Jochen Schalanda
e82546f342
Update generated build files for REST Assured (#5873)
* REST Assured 4.3.0
* Jackson 2.10.3
* Gson 2.8.6, GSON-Fire 1.8.4
* Okio 1.17.5
* Joda-Time 2.10.5
* ThreeTenBP 1.4.3
* Added missing dependencies for Bean Validation
* Added missing dependencies for `@Generated` annotation
* Refresh REST Assured sample project
2020-04-12 23:36:18 +08:00
Artem Shubovych
62c346f8da
[enhancement] [jaxrs-spec] Add builders to models (#4930)
* Update formatting in jaxrs-spec POJOs

* Add generateBuilders option

* Update formatting in jaxrs-spec POJOs

* Disable the builders generation by default

* Ensure samples are up-to-date

* Revert newline change

* Run ensure-up-to-date

* update doc

* fix merge conflicts

Co-authored-by: Artem Shubovych <ashubovych@atlassian.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 17:27:34 +08:00
Yuriy Belenko
1c51d4138e
[mysql] Add basic SQL queries (#5757)
* Add basic SQL queries template

* Add namedParametersEnabled option

* Move model related SQLs into Model folder

* Update README template

* Refresh samples
2020-04-12 16:49:50 +08:00
Gonzalo
6a158de431
Add date time format annotation on pojo for model query parameters (#5437)
* Add date time format annotation on pojo for model query parameters

* Regenetare samples

* update spring samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 09:39:16 +08:00
Shinya Sugmoto
800293ccf9
[Dart] Fix "basic" auth method and Add Bearer token support (#5743)
* added auth check and lint

* fixed basic auth condition

* Added bearer auth

* updated samples

* update dart petstore samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-12 09:38:15 +08:00
Shweta Shukla
58dc48da8d
Update modelGeneric.mustache (#5378)
* Update modelGeneric.mustache

If maxlength is specified for a property type enum it there should be .ToString() appended before length check

* ran the csharp petstore bar and updated the file

Co-authored-by: Shweta Shukla <shshukl@microsoft.com>
2020-04-11 22:45:30 +08:00
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
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
ceef040e37 update mysql samples 2020-04-07 16:46:32 +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
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