8767 Commits

Author SHA1 Message Date
sunn
ab5f224634
Support abort operation (#5114) 2020-01-27 16:00:58 +01:00
Slavek Kabrda
a42ff37a42 [java][client] oneOf support for jackson clients (#5120) 2020-01-27 08:23:20 -05:00
aanno2
d111e3a359 [REQ][typescript-angular]: support for object as query parameters (#4407)
* https://github.com/OpenAPITools/openapi-generator/pull/4407 squashed from original, and better author (I failed to refer the right PR the first time)

* removed isArrayLike in favour of Array.isArray

* support collectionFormat the old way

* fixed type and rebuild samples

* revert samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/package.json

* reverted samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/tsconfig.json

* rebase-to-master-fix: isDateTime stuff is now handled within this.addToHttpParams

* run bin/typescript-angular-petstore-all.sh on the rebased PR

* applying proposed fix of @macjohnny

* run bin/typescript-angular-petstore-all.sh to regenerate samples

Co-authored-by: aanno <aanno@users.noreply.github.com>
2020-01-27 09:40:58 +01:00
Marcin Stefaniuk
19a5f1248e Typescript Axios returned types and export paths fixed (#5102)
* Typescript Axiom templates fixed

Templates fixed to have `withInterfaces` and `withSeparateModelsAndApi` options working combined.

* Added petstore generated samples for typescript-axios

* Fixing line endings

* Remove unnecessary change in function signature

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* re-generate typescript-axios samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-01-27 09:40:28 +01:00
Bernd Hacker
45f26fe0bd [typescript-rxjs] performance improvements, bugfix for falsy parameters (#4250)
* perf(typescript-rxjs): remove redundant check when building auth header

* feat(typescript-rxjs): destructure request parameters, add throwIfNullOrUndefined helper, build query object more efficently

* fix(typescript-rxjs): change form checks back from null to undefined

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): add hasRequiredQueryParams flag for improved query object generation

* feat(typescript-rxjs): remove trailing comma in param destructuring, improve formatting via hasOptionalQueryParams flag

* feat(typescript-rxjs): remove useless generics in BaseAPI

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): extend CodegenParameter by output.paramNameAlternative and output.paramNameOrAlternative

* refactor(typescript-rxjs): remove obsolete reservedWords RequiredError and exists

* feat(typescript-rxjs): add reservedParamNames list with headers, query and formData, extend param processing

* feat(typescript-rxjs): use paramNameOrAlternative in api template

* refactor(typescript-rxjs): replace paramNameOrAlternative prop with mustache partial

* refactor(typescript-rxjs): reduce branching in configuration's apiKey() and accessToken()

* refactor(typescript-rxjs): remove unused ModelPropertyNaming

* feat(typescript-rxjs): regenerate samples

* feat(typescript-rxjs): remove CodegenParamter's paramNameAlternative, use vendorExtensions instead

* docs(typescript-rxjs): regenerate readme
2020-01-27 09:31:36 +01:00
Sebastien Rosset
4f350bc01c [Python] Support for HTTP signature (#4958)
* start implementation of HTTP signature

* add api key parameters for http message signature

* HTTP signature authentication

* start implementation of HTTP signature

* add api key parameters for http message signature

* HTTP signature authentication

* HTTP signature authentication

* start implementation of HTTP signature

* fix merge issues

* Address formatting issues

* Address formatting issues

* move python-experimental-openapiv3-sample to a separate PR

* Add support for HTTP signature

* Add code comments

* Add code comments

* Fix formatting issues

* Fix formatting issues

* Fix formatting issues

* add code comments

* add code comments

* fix python formatting issues

* Make PKCS1v15 string constant consistent between Python and Golang

* fix python formatting issues

* Add code comments in generated Python. Start adding unit tests for HTTP signature

* compliance with HTTP signature draft 12

* compliance with HTTP signature draft 12

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* working on review comments

* fix python formatting issues

* fix trailing white space

* address PR comments

* address PR comments

* address PR comments

* Add suppport for '(expires)' signature parameter

* address PR comments

* address PR comments

* Fix python formatting issues

* Fix python formatting issues

* Starting to move code to dedicated file for HTTP signatures

* Continue to refactor code to dedicated file for HTTP signatures

* Continue to refactor code to dedicated file for HTTP signatures

* Continue to refactor code to dedicated file for HTTP signatures

* Continue to refactor code to dedicated file for HTTP signatures

* move method to ProcessUtils

* conditionally build signing.py

* move method to ProcessUtils

* Code reformatting

* externalize http signature configuration

* address PR review comments

* address PR review comments

* run samples scripts

* Address PR review comments

* Move 'private_key' field to signing module

* Move 'private_key' field to signing module

* code cleanup

* remove use of strftime('%s'), which is non portable

* code cleanup

* code cleanup

* code cleanup

* run sample scripts

* Address PR review comments.

* Add http-signature security scheme

* Run sample scripts for go

* Fix issue uncovered in integration branch

* Fix issue uncovered in integration branch

* Fix issue uncovered in integration branch

* Fix issue uncovered in integration branch

* Run samples scripts

* move http signature tests to separate file

* move http signature tests to separate file

* unit tests for HTTP signature

* continue implementation of unit tests

* add http_signature_test to security scheme

* add unit tests for http signature

* address review comments

* remove http signature from petapi

* Add separate OAS file with support for HTTP signature

* Add support for private key passphrase. Add more unit tests

* Add unit test to validate the signature against the public key

* remove http signature from petstore-with-fake-endpoints-models-for-testing.yaml

* fix unit test issues

* run scripts in bin directory

* Refact unit test with better variable names

* do not throw exception if security scheme is unrecognized

* change URL of apache license to use https

* sync from master

* fix usage of escape character in python regex. Fix generated python documentation

* write HTTP signed headers in user-specified order. Fix PEP8 formatting issues

* write HTTP signed headers in user-specified order. Fix PEP8 formatting issues

* http signature unit tests

* Fix PEP8 format issue

* spread out each requirement to a separate line

* run samples scripts

* run sample scripts

* remove encoding of '+' character
2020-01-26 18:17:26 -08:00
Richard Whitehouse
84b6804d8f [Core, Rust Server] Support multipart/related requests (#5015)
* [Core, Rust] Support multipart/related requests

* Treat multipart/related as a type of form data
2020-01-26 20:39:43 -05: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
Sebastien Rosset
20afa870a9 [CORE] Add support for HTTP signature (#4993)
* Add support for HTTP signature

* Add http-signature security scheme

* add http_signature_test to security scheme

* Add separate OAS file with support for HTTP signature

* change URL of apache license to use https

* add log warning to indicate the 'http signature' security scheme is still a draft
2020-01-26 11:48:22 -05:00
Tatsuro Shibamura
305b7279ee [csharp-netcore] Update RestSharp and improve async methods (#5066)
* Update RestSharp and improve async methods

* Fixed missing type parameter

* Update sample code

* Update README

* Update RestSharp version for CI

* Fixed sample test projects
2020-01-25 19:07:50 -05:00
Jim Schubert
c9ec084418
🐛 Fixing some issues with threading and NPE (#5107)
* 🐛 Fixing some issues with threading and NPE

After running Sonar on the master branch, some major analysis
opportunities were displayed.

This fixes the use of SimpleDateFormat stored as static fields.
SimpleDateFormat is not thread-safe, and may retain data across threads.
While there's no indicator that this has caused any issues (these are
mostly used for example code), we should follow these best practices.

This also fixes a handful of NPE and other minor issues such as
comparing Boolean.TRUE to strings and no wrapping some closeables in
try-with-resources.

* [cli] Unit test GenerateBatch custom deserialization helper

* Quiet batch mode in sonar.yml

* Suppress unnecessary warnings (ThreadLocals in static fields)
2020-01-25 18:28:16 -05:00
Richard Whitehouse
52e09e2ffa
[Rust Server] Handle array of objects inside an object correctly (#5044)
Use correct data type for arrays inside objects.

Add test for arrays of objects

Update samples
2020-01-25 18:23:20 +00:00
Richard Whitehouse
2714af4922
[Rust Server] Sanitise enum values (#5042)
[Rust Server] Sanitize enum values
2020-01-25 16:26:05 +00:00
Richard Whitehouse
32222da435
[Rust Server] Add support for primitive arrays (#5041)
[Rust Server] Add support for primitive arrays
2020-01-25 16:25:20 +00:00
Alexey Makhrov
15d31f753d [typescript-angular] Sanitize/transform model name after appending model suffix (#5105)
This makes sure the final (suffixed) model name is checked against the TS keywords / reserved names.
2020-01-24 22:59:47 +01:00
Erik Timmers
7e16a1f58c
[elm] Fix duplicate coder names (#5100)
* [elm] Add signature to enum variants

* [elm] Fix field encoders/decoders
2020-01-24 11:04:00 +01:00
Mila Rodriguez
524ef63e37 Fix typescript model kebab-cased filenames #5073 (#5085)
Updated StringUtils to collapse consecutive underscores and/or whitespace into a single dash when "dashizing".
2020-01-24 08:56:15 +01:00
Chris Couzens
b77bffeae1 Typescript axios: remove use of btoa (#5098)
btoa (binary to ascii), is a javascript function to base64 encode a
string.

Axios is usable both from node and from the browser. But the btoa
function is available only in the browser.

This meant that any client that used basic auth was broken in node.
Axios has its own method of encoding basic auth credentials. This method
works in both the browser and node.
https://github.com/axios/axios/blame/v0.19.2/README.md#L318

By using this method, the generated client works in node and in the
browser.

This solves this comment on this issue.
https://github.com/OpenAPITools/openapi-generator/issues/3049#issuecomment-498278966

I have validated this change within a personal project:
df8b552f5f (diff-e91249994e03dd6af8c6bee4ff7d8381)
2020-01-24 07:16:35 +01:00
Sebastien Rosset
327ffc10bb [HttpBasicAuth] Use positive isBasicBasic tag instead of negative isBasicBearer (#5095)
* use positive isBasicBasic tag instead of negative isBasicBearer

* use positive isBasicBasic tag instead of negative isBasicBearer
2020-01-24 10:35:56 +08:00
Sebastien Rosset
75d5569e92 [go] Fix multiple go compilation errors and enable go integration test in pom.xml (#5075)
* fix go compilation error for properties of type map and array

* fix go compilation error for properties of type date and datetime

* add missing shell script to bin/utils/ensure-up-to-date

* add missing shell script to bin/utils/ensure-up-to-date

* add missing shell script to bin/utils/ensure-up-to-date

* fix issue with 'date' type

* fix time import problem

* Add missing pom.xml files for golang

* Add missing unit test files for golang

* Add missing unit test files for golang. Must use class name prefix for enums

* Fix unit tests for go-experimental in OAS3

* Fix unit tests for go-experimental in OAS3

* Add code comments in codegen

* Fix compilation errors of generated go code

* Fix compilation errors of generated go code

* remove antihax from go-experimental, it is no longer used

* copy python testfile for ut purpose

* add error checkout in unit tests

* add unit tests

* add code comments

* move test foo.png file to correct location

* run samples scripts

* run samples scripts
2020-01-24 09:54:26 +08:00
sunn
138232d557
[C++] [Qt5] Add request compression and handling identity (#5088)
* Add request and response compression and handling identity

* Minor updates for identity and if conditions
2020-01-23 20:43:40 +01:00
Erik Timmers
71128f712c
[elm] enum items and parameters (#5051)
* [elm] Fix generating arrays of enums

* [elm] Add suffix to operation parameters

So there are no longer conflicts between parameters or
parameters and operation names.
2020-01-23 13:13:24 +01:00
Erik Timmers
efc452513b
[elm] Fix decoding empty operation responses (#5055) 2020-01-23 10:28:13 +01:00
Yuriy Belenko
0366e946ba [Slim4] Add string formats support to Data Mocker (#4975)
* [Slim4] Support byte data format

* [Slim4] Support date and date-time data formats

* [Slim4] Support password data format

* [Slim4] Support uuid data format

* [Slim4] Fix test of password format mocking

'00000' is numeric type, because PHPUnit doesn't make strict type
comparison.

* [Slim4] Fix data format key in object mocking

* [Slim4] Support binary data format

* [Slim4] Support email data format

* [Slim4] Base64 encode binary format output

Raw bytes string breaks PHP stdout output, so I've decided to use base64
encoding format for binary format too.

* [Slim4] Refresh samples
2020-01-23 16:18:18 +08:00
Jim Schubert
bcff006dc8
[python] Fix NPE in example generation (#5082) 2020-01-22 19:22:18 -05:00
Jim Schubert
ac528aaf07
[test] Removes jmockit in favor of mockito (#5063)
* [test] Removes jmockit in favor of mockito

We use mockito in many tests. This removes jmockit which is run as a
javaagent in favor of Mockito which is not.

This work is in preparation for applying some static analysis tools,
while evaluating others such as Jacoco. I'm also look at ways to improve
build times while also decreasing "ramp up time" for contributions from
the community. Reducing the number of mock frameworks and dependencies
is a step toward that goal.

* Rename method in new.sh

* [cli] Mock the generate task
2020-01-22 18:04:00 -05:00
Michele Albano
bf57a9960d Rebased to current upstream/master. (#4514)
Tests for python client, comprising support for additional_properties and arrays.
There are ugly workarounds for when there are discriminators, since the python client generator does not fully handle them.
Cool indentation of test files.
2020-01-22 22:08:53 +08:00
dependabot[bot]
fc4563baef Bump spring-webflux from 5.0.8.RELEASE to 5.1.0.RELEASE in /samples/client/petstore/java/webclient (#5071)
* Bump spring-webflux in /samples/client/petstore/java/webclient

Bumps [spring-webflux](https://github.com/spring-projects/spring-framework) from 5.0.8.RELEASE to 5.1.0.RELEASE.
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.0.8.RELEASE...v5.1.0.RELEASE)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump spring-webflux version from 5.0.8 to 5.0.16

ref https://pivotal.io/security/cve-2020-5398

Co-authored-by: Akihito Nakano <sora.akatsuki@gmail.com>
2020-01-22 17:00:52 +08:00
Sebastien Rosset
63859d6d51 Add python-experimental-openapiv3-sample (#4992)
Add python-experimental-openapiv3-sample

Add missing files for the Python samples

Add python-experimental-petstore.bat for openapi v3

Add python-experimental samples openapi v3

Add python-experimental samples openapi v3

Add python-experimental samples openapi v3. Address review comments

add missing files for test purpose

fix python formatting issues

fix python formatting issues

fix python formatting issues

Fix unit tests

fix python formatting issues

fix python formatting issues

fix python formatting issues

fix 'line too long' pep8 error

address PR comments for pep8 'line too long' problem

regenerate samples

execute samples scripts

dummy commit to retrigger circleci

Revert dummy commit, it didn't help.
2020-01-21 23:19:07 +08:00
Bruno Coelho
95bd32d474 [swift5][client] return ErrorResponse.error when network parsing error (#5068) 2020-01-21 22:32:31 +08:00
Sai Giridhar P
6a228e8006 [csharp-netcore] Adding additional package metadata (#5065)
* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding license expression

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Adding other package metadata fields

* fix(csharp-netcore): Minor fixes

* fix(csharp-netcore): Updating example projects

* fix(csharp-netcore): Removed carriage return

* fix(csharp-netcore): Removed carriage return
2020-01-21 22:10:33 +08:00
sunn
a1d21f6d3a
[C++] [Qt5]Add support for response compression and add response body to error s… (#5060)
* Add support for response compression and add response body to error string

* Improve robustness while parsing quality and compression levels
2020-01-21 12:11:43 +01:00
Sebastien Rosset
ff7203875f fix compilation error in generated go code (#5061) 2020-01-21 17:32:38 +08:00
Sai Giridhar P
ad009180dd fix(r): Adding repository url (#5056) 2020-01-21 10:47:05 +08:00
Mateusz Szychowski (Muttley)
6af27d52ca [C++][Pistache] Rename value holder to lower chance of collision with parameter name (#4948)
* [C++][Pistache] Rename value holder to lower chance of collision with parameter name

* [C++][Pistache] Update Petstore sample
2020-01-21 00:47:26 +01:00
Jim Schubert
2bc3c196e8
[aspnetcore] Fix duplicate enums (#5059)
* [aspnetcore] Fix duplicate generation of enums

Fixes template issue where enums defined within a class were generated
regardless of whether they were a complexType (externally defined
"model") or an inlined enum.
2020-01-20 16:37:15 -05:00
Liam Martens
7599531960 Fixed call of toISOString on a string type when using string type-mapping (#5057) 2020-01-20 16:59:16 +01:00
William Cheng
4ec3900d31 undo restoring ElmClientCodegenTest.java 2020-01-20 17:53:11 +08: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
Đào Hoàng Sơn
3a8e598ca2 [dart-dio] Various fixes (#5027)
* [dart-dio+time_machine] Add missing import, serializer

* [dart-dio] Remove bad import from `http` package

* [dart-dio] Use raw strings for those that contain variable name.

This should eliminate potential issue with variables like `$ref`.

* [dart-dio] Use `_path` instead of `path` to avoid potential conflict with op params.

See 1bec0b47b1/Kubernetes.json, there are a few with `{path}` param.

* [dart-dio+time_machine] Use `OffsetXxx` classes for date time values
2020-01-20 11:56:24 +08:00
Sebastien Rosset
449026add7 Add java code comments based on explanation from Jim Schubert (#5048) 2020-01-19 21:18:15 -05:00
Jim Schubert
644f720db8
[docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
* [config-help] Sort all outputs

* Remove old/stale generator docs (these have been renamed previously)

* Sort config doc outputs, making it easier to find relevant info

* Fixes cliOptions duplicates

Erlang client/proper improperly set the version option as packageName
(causing duplicate for packageName).

The java and swift option removals are because the options are added in
parent classes, resulting in duplication of the options.

* Add --github-nested-index for generating docs/generators/README.md

* 📝 Regenerate generator docs
2020-01-19 20:19:11 -05:00
Sebastien Rosset
d61dcc17e0 [gradle] consistent use of maven url in gradle files (#5045)
* wrap maven url with uri function

* consistent use of maven url in gradle files
2020-01-19 14:57:38 -05:00
Jim Schubert
23131c1a63
Use HTTPS Maven URL in Kotlin meta generator (#5043)
This continues on work in #5033 and #5034 which convert all http usage
to https to unblock CircleCI builds.

In #5034, mavenCentral() DSL was updated to explicitly target the https
maven repo because Gradle didn't force TLS 1.2 until v4.8.1 and many of
our examples use earlier versions of Gradle.  The Kotlin meta generator
was missed because it is a .kts build file rather than build.gradle, and
the mustache filename doesn't have kts in it; the file was updated as if
it was build.gradle (groovy syntax).
2020-01-19 10:42:25 -05:00
William Cheng
fff759b79c
[Python] fix numeric enum in python flask, aiohttp (#5019)
* minor code format fix

* fix numeric enum in python flask and aiohttp

* add python-server-all.sh to ensure-up-to-date
2020-01-19 15:25:20 +08:00
William Cheng
6a34706a9b
add multipleOf to various codegen classes (#5021) 2020-01-19 13:39:26 +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
William Cheng
d1948c4b41
better code format in java jersey doc (#5031) 2020-01-18 19:11:51 +08:00
Nicholas Muesch
2722c602ac Escape query params before invoking api (#5023)
* Escape query params before invoking api

* Update petstore file

* Update remaining petstore examples
2020-01-18 17:25:18 +08:00