Commit Graph

13431 Commits

Author SHA1 Message Date
Alexey Makhrov
845acce4af
Remove typeMapping for "List" from AbstractTypeScriptClientCodegen (#5160) 2020-01-30 08:47:08 +01:00
Justin Black
a51d02ac61
[Python] Fix #5126 operations with req enums of length one (#5129)
* Updates ap.mustache for python-experimental, adds test test_test_endpoint_enums_length_one

* Removes sortParamsByRequiredFlag from python-experimental

* Removes duplicate params from docstring
2020-01-29 10:10:41 -08:00
Tatsuro Shibamura
3922607858
[csharp-netcore] Fixed compiler null-check warning (#5119)
* Fixed compiler null-check warning

* Rename vendor extensions as `x-csharp-value-type`
2020-01-30 00:52:48 +08:00
Jim Schubert
76e8e81668
[core] Add back functionality to debug openapi spec, accidentally removed in 4.1.2 (#5147) 2020-01-29 08:30:20 -05:00
LoveIsGrief
6cf58afdc5
Switch to predominant use of appDescriptionWithNewLines in README.mustache (#5109)
Descriptions tend to get lengthy and can include multiple lines.
New lines are important to markdown formatting/syntax and can't just be ignored.

Resolves https://github.com/OpenAPITools/openapi-generator/issues/3704
2020-01-29 17:18:57 +08:00
Hui Yu
f4185b8d9e
[C-libcurl] Support HTTPS/SSL for the C client (#5140) 2020-01-29 16:57:31 +08:00
Tatsuro Shibamura
e27700cfee
[csharp-netcore] Support .NET Core 3.0/3.1 and .NET Standard 2.1 (#5111)
* Add .NET Core 3.x / .NET Standard 2.1

* Fixed test project target framework

* Fixed missing sync property

* Update generator docs
2020-01-29 16:50:06 +08:00
Yutaka.Miyamae
8214460ec5
Add deprecated annotation in kotlin-spring (#5090)
* add Deprecated in kotlin dataClass

* add deprecated in CodegenProperty

* format (Column limit: 100)

* set property.deprecated

* add test

* run ./bin/kotlin-springboot-petstore-all.sh

* trim space
2020-01-29 16:30:33 +08:00
Jim Schubert
1ac0f141a6
[feature] Default CI log level for slf4j-simple to error to prevent noise (#5118)
* [feature] Log "debounce" filter to remove spam.

* [log] slf4j-simple should be optional

This also sets the default log level to ERROR during CI builds for many
mvn invocations. This should reduce noise in the logs.

* [log] Rely only on mvn loglevel=error for now

* [cli] Clean up unused dependency

* [log] Change level to error/warn in more CI
2020-01-29 16:28:42 +08:00
William Cheng
f37951a0ba
Add a link to dev.to article (#5142) 2020-01-29 16:20:50 +08:00
William Cheng
0f48ab8b15
Add bkabrda to Java technical committee (#5141) 2020-01-29 16:09:08 +08:00
Fabian von Feilitzsch
15345e1620
[python] Cleanup ThreadPool with atexit rather than __del__ (#5094)
* [python] Cleanup ThreadPool with atexit rather than __del__

This removes the `__del__` function from the generated Python client,
and replaces it with a `cleanup` function. When a ThreadPool is created,
the cleanup function is registered with the `atexit` module.

This fixes #5093, where the API client could hang indefinitely at
garbage collection.

* Update petstore examples

* Test to ensure threadpool is cleaned up

* Docs now encourage using the context manager

* Regenerate docs

* Update samples
2020-01-28 21:58:11 -08:00
Jim Schubert
d627282e89
[go] Allow user overrides for generated outputs (#5132) 2020-01-28 20:29:10 -05:00
Hui Yu
f152a22094
[C-libcurl] Add object.c to CMakeLists to compile (#5130)
* [C-libcurl] Add object.c to CMakeLists to compile

* [C-libcurl] Add object.h/object.c to CMakeLists of sample
2020-01-29 01:34:51 +01:00
Alexey Makhrov
105ce99039 [typescript-angular] Import models from a single model/models.ts (#5128)
* Make api to models from a single model/models.ts instead of individual model files.
Fixes inconsistent usage of file names with inline models (inline-model-1, inline-model-2, ...)

* Remove additional mapped filename prop from api imports (since it's not reliable)

* Rerun ./bin/typescript-angular-petstore-all.sh

* Restore the `filename` property passed to the templates, with a comment it's no longer used
2020-01-28 08:23:18 +01:00
sunn
ab5f224634
Support abort operation (#5114) 2020-01-27 16:00:58 +01: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
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
Jim Schubert
d8c9f25b10
Update sonar.yml
Limit next-version release branches to those ending in `.x`
2020-01-26 11:36:11 -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
Jim Schubert
ad4a9df328
Update sonar.yml
Set GITHUB_REF with replacement to remove refs/heads prefix
2020-01-24 22:37:27 -05:00
Jim Schubert
9928f3c375
Update sonar.yml 2020-01-24 22:25:58 -05:00
Jim Schubert
43b6272fc6
Update sonar.yml 2020-01-24 22:18:13 -05:00
Jim Schubert
5220d7cd59
Create sonar.yml 2020-01-24 22:13:08 -05: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
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
Jim Schubert
09fd494836
Adds jacoco for code coverage (#5084)
* Adds jacoco for code coverage

This sets up jacoco instrumentation for code coverage. Preparing for
master and PR coverage reporting via sonarcloud.

* Set initial required coverage to 0
2020-01-23 23:46:07 -05: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
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
Bruno Clermont
6f5f16aaee Add company using generator (#5064) 2020-01-21 13:40:32 +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