14377 Commits

Author SHA1 Message Date
Tino Fuhrmann
efb9722757 Restore changes to CONTRIBUTING.md from PR #6489 2020-06-14 19:44:04 +02:00
Tino Fuhrmann
8ab532eed2 Merge master 2020-06-13 21:36:02 +02:00
Bodo Graumann
4608264a12
[Typescript] Support InversifyJS (#6489)
* Add config option to enable InversifyJS

* Add pascal case lambda for mustache

* Generate a class for each auth method

* Add service identifiers and service binder helper

* Split Configuration into interface and factory

This way we don't need to import the factory everywhere to do
typechecking.

* Define minimal interface for ServerConfiguration

* Add annotations for inversify when enabled

* Always expose list of server configurations

* Add samples and defalt tests for useInversify

* Simplify sample generation script

* Fix: Add object_params arg description to help

* Fix: Properly enable inversify with bool property

* Build tests in pom instead of prepublish

Otherwise running `npm install`, when the build failed was impossible.

* Update dependencies for inversify tests

* Test basic api service resolution

* Remove Promise and Observable prefix from exports

* Fix, RxJS: Import Observable in object params api

* Add ioc service identifier for object param api

* Add hint about unimpeded development

* Simplify api service binder syntax

* Remove default tests for inversify

* Add wrapper for easy promise based http libraries

This wrapper allows defining and injecting http libraries that do not
need to know anything about observables, especially when useRxJS is not
enabled. I will employ this in the tests for InversifyJS.

Not sure if we should also use this wrapper internally.

* Add named injects for remaining auth parameters

* Directly inject promise services without RxJS

* Add tests for api service binder

* Add convenience method to bind all api services

* Fix: Rename inversify test artifact

* Run bin/utils/copy-to-website.sh
2020-06-13 21:26:08 +02:00
William Cheng
a4e42e1651
[Java][Retrofit2] deprecate RxJava 1.x (#6641)
* deprecate rxjava1.x

* update samples
2020-06-13 14:30:22 +08:00
William Cheng
8fc65d04a5
Add PowerShell to ensure-uptodate (#6638)
* add powershell to ensure-uptodate

* remove API

* add back API
2020-06-13 14:27:19 +08:00
Benoît Courtine
8e2bf99ffb
[Rust][Client][Reqwest] Better http error handling (#6481)
* Stronger typing for http errors with Rust client. (#5609).

* Error structure can be parametrized (but is still hardcoded with `serde_json::Value` in generated code).

* Each API method has is own enum of functionnal errors.

* Fix the missing "Debug" derivation for API error enums.

* Generate models for error deserialization.

* Handle several 2xx success models.

* Expose new API objects, required to use the API (params, success, error structs/enums).

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-13 12:28:53 +08:00
William Cheng
eb26fe51db Merge branch 'master' of https://github.com/openapitools/openapi-generator 2020-06-13 00:15:41 +08:00
Sebastien Rosset
690f36d946
[java][jersey2] Add hook to customize SSL context, trust manager and host verifier (#6633)
* Add hook to customize SSL context, trust manager and host verifier

* run sample scripts
2020-06-13 00:15:24 +08:00
William Cheng
f36b807091 Merge branch 'master' of https://github.com/openapitools/openapi-generator 2020-06-13 00:14:58 +08:00
William Cheng
e84ec710d8 update objc samples 2020-06-13 00:05:14 +08:00
Sebastien Rosset
3626bc4bf4
Fix URL encoding problem for HTTP signatures (#6637) 2020-06-13 00:02:45 +08:00
onlymate
a0f229302d
added basic bearer authentication to objc template (#6640) 2020-06-12 23:57:50 +08:00
William Cheng
e2e83fc7bf
Remove jacoco from pom.xml (#6558)
* remove jacoco from pom

* test run-in-docker

* Revert "test run-in-docker"

This reverts commit d97fc2365a7d4c0cb834cee463ea9ee2c1b7a9fb.

* Revert "remove jacoco from pom"

This reverts commit f5d0cc2e202f902e000e45a347f3451e48b6da77.

* add -Djacoco.skip=true
2020-06-12 21:48:46 +08:00
William Cheng
b049a5d466 update doc 2020-06-12 17:59:01 +08:00
William Cheng
f092b98a90 update samples 2020-06-12 17:36:54 +08:00
tgerth
146bfeb6d6
[JAVA] RxJava3 support (#6622)
* rx3 support

* ran the shell script ./bin/generate-samples.sht

* added missing rx3 migration, removed tabs
2020-06-12 17:23:42 +08:00
William Cheng
8689625af3
Fix default response (#6625)
* fix isDefault in response

* fix response

* update samples

* fix scala akka template

* fix elm template

* remove commented code

* remove eof

* update elm samples
2020-06-12 15:49:26 +08:00
Jim Schubert
defb0bceeb
Update building.md (#6635)
Fix invalid yaml in building docs
2020-06-11 23:07:22 -04:00
Jiri Kuncar
046ba7de8e
[feature][python] Support aliasing of API keys (#6469)
* [python] Support aliasing of API keys

* Support for aliasing and prefix

* Make more realistic usage

* Regenerate

* Document alias in generated code

* Support override of aliased keys

* Use diferent id and name for api keys

* ensure up-to-date

* Simple example without x-auth-id-alias

* regenerate docs

* Regenerate

* Provide separate spec for x-auth-id-alias

* Apply suggestions from code review

* regenerated
2020-06-11 09:19:57 -07:00
Jim Schubert
0cb080d5f1
[ci][cli] Allow invoking generate-samples.sh with single file + args (#6609) 2020-06-11 23:39:26 +08:00
johnthagen
28387a09bc
Add missing brew tap command to README instructions (#6629) 2020-06-11 23:30:25 +08:00
Alexander Karkossa
2128f2875e
Enhancement/kotlin/apiclient and auth (#6585)
* Add multiple auth methods to ApiClient. ApiClient more configurable

* Fixed missing close tag for isMultipart in api.mustache

* Generated samples ./bin/kotlin-client-all.sh

* Generated samples./bin/openapi3/kotlin-client-petstore-all.sh

* Use of better way to add supporting files based on conditions

* Fixed missing check for retrofit generating auth files

* Generated samples

Co-authored-by: Alexander Karkossa <alexander.karkossa@dataport.de>
2020-06-11 22:09:13 +08:00
Mostafa Moradian
3b9cb14025
[fix] Fix delete http verb (the k6 equivalent is del) (#6624) 2020-06-11 20:59:21 +08:00
Ben Drucker
f373f20639
go: use PathEscape instead of QueryEscape to escape path params (#6618) 2020-06-11 17:53:52 +08:00
Warren Gray
933ab0640a
[python-client] Enable per-request auth settings (#6569)
* Enable per-request access token in Python client.

* Add missing regenerated sample files.

* Rework to the more general case of overriding the auth settings for a request.

* Add unit tests.

* Update api_client.mustache so that request_auth overrides all other auth settings when specified.
2020-06-10 23:40:10 -07:00
Jiri Kuncar
ebcce67419
[Python] Update docstring and fix a typo (#6612)
* [Python] Update docstring and fix a typo

* regenerate
2020-06-10 19:06:39 -07:00
sunn
31d05f3f48
Fix compilation on Windows (#6608) 2020-06-10 16:09:04 +02:00
sa9sha9
9fdcbec64b
Disabling linting for typescript-axios (#6613)
* Disable linting for typescript-axios

* Update samples of typescript-axios

* Regenerate petstore samples of typescript-axios
2020-06-10 14:25:57 +02:00
bgong-mdsol
71dc054d82
Use builder pattern for requests (#5961) 2020-06-10 18:50:35 +08:00
Pierre Bérubé
a014915e62
Fix Basic Bearer auth examples for HTML2 Docs (#6579)
* add missing basic bearer auth examples

* fix basic bearer auth header

* add bearerFormat

* fix all template formats and whitespacing
2020-06-10 17:38:22 +08:00
William Cheng
104a2a39b8
remove localVariablePrefix (#6588) 2020-06-10 17:22:06 +08:00
Julien Feltesse
5c893d5664
remove the json dependency (#6580) 2020-06-10 17:20:16 +08:00
William Cheng
f2a615d693
Update PR checklist for Windows users (#6599)
* Update PR checklist for Windows users

* update contributing

* update building doc

* update doc
2020-06-10 16:43:26 +08:00
William Cheng
db10bba1e3
Update rust config (#6600)
* update rust config

* update rust reqwest async sample
2020-06-10 16:23:15 +08:00
Sebastien Rosset
a4d679f9e5
[Golang] enable unit test for ecdsa keys (#6593)
* Mustache template should use invokerPackage tag to generate import

* Enable unit tests for ECDSA keys

* fix unit test

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
2020-06-10 15:47:13 +08:00
Sebastien Rosset
4bbe3cdbc9
[Java][jersey2] Fix Java compiler warnings (#6605)
* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

* [java][jersey2] Add support for discriminator, fix nullable typo and nullable deserialization (#6495)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* update samples

* add tests to oas3 java jersey2 petstore

* Fix 'method too big' error with generated code

* resolve merge conflicts

* comment out jersey2 ensure uptodate

* fix compiler warnings

* Jersey2 supports additional properties with composed schema (#6523)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

* Set supportsAdditionalPropertiesWithComposedSchema to true for Java jersey2

* Support additional properties as nested field

* Support additional properties as nested field

* add code comments

* add customer deserializer

* Fix 'method too big' error with generated code

* resolve merge conflicts

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* [Jersey2] Fix code generation of 'registerDiscriminator' method for large models (#6535)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

* Fix 'method too big' error with generated code

* resolve merge conflicts

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* Add unit test for date time

* Add unit test for date time

* update samples

* comment out tests

* support additional properties in serialize and deserialize

* add discriminator lookup

* remove oneof/anyof logic in apilcient

* add serializer to mammal.java

* add serialize to oneOf model

* add serializer to anyof model

* comment out test cases that are subject to further discussion

* add back files

* update configs, samples

* resolve merge conflicts

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-10 11:52:38 +08:00
Sebastien Rosset
0b561d6075
fix import of JSON class (#6606) 2020-06-10 11:50:25 +08:00
William Cheng
fd2976b89c
use legacy discriminator mapping (#6604) 2020-06-10 11:27:53 +08:00
William Cheng
233087c5aa
[Java][Jersey2] various improvements (#6518)
* [java][jersey2] Add support for discriminator, fix nullable typo and nullable deserialization (#6495)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* update samples

* add tests to oas3 java jersey2 petstore

* comment out jersey2 ensure uptodate

* Jersey2 supports additional properties with composed schema (#6523)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

* Set supportsAdditionalPropertiesWithComposedSchema to true for Java jersey2

* Support additional properties as nested field

* Support additional properties as nested field

* add code comments

* add customer deserializer

* Fix 'method too big' error with generated code

* resolve merge conflicts

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* [Jersey2] Fix code generation of 'registerDiscriminator' method for large models (#6535)

* Mustache template should use invokerPackage tag to generate import

* fix typo, fix script issue, add log statement for troubleshooting

* Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme

* Add sample for Java jersey2 and HTTP signature scheme

* Add unit test for oneOf schema deserialization

* Add unit test for oneOf schema deserialization

* Add log statements

* Add profile for jersey2

* Temporarily disable unit test

* Temporarily disable unit test

* support for discriminator in jersey2

* fix typo in pom.xml

* disable unit test because jersey2 deserialization is broken

* disable unit test because jersey2 deserialization is broken

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* Add code comments

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts

* resolve merge conflicts

* Add unit tests

* fix unit tests

* continue implementation of discriminator lookup

* throw deserialization exception when value is null and schema does not allow null value

* continue implementation of compose schema

* continue implementation of compose schema

* continue implementation of compose schema

* Add more unit tests

* Add unit tests for anyOf

* Add unit tests

* Fix 'method too big' error with generated code

* resolve merge conflicts

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>

* update samples

* comment out tests

* support additional properties in serialize and deserialize

* add discriminator lookup

* remove oneof/anyof logic in apilcient

* add serializer to mammal.java

* add serialize to oneOf model

* add serializer to anyof model

* comment out test cases that are subject to further discussion

* add back files

* update configs, samples

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
2020-06-10 00:38:11 +08:00
Jim Schubert
60ceded171
[ci][cli] Moving ensures script to config-based batch generation of samples (#6509)
* Ensure CLI-level generator settings are available in additional properties

* Initial conversion to yaml configs

Configs prefix with 1- need to be manually evaluated.

* Add "other" configs not in ensure-up-to-date

* Add other/openapi3 files

* Cleanup all generation scripts

* Clean up: add missed configs and fix some openapi 3 diffs

* Move generate-samples script, error on batch failures

* Temporarily disable elm which requires skip validation of spec

* CI updates (todo: run all generators through appveyor or move to github workflows)

* Add success count to batch generation command output

* [samples] Regenerate

* Remove bin/windows

* Generate swift5 samples in bitrise

* Expand user input glob pattern

* Regenerate samples

* Update PR template

* Support config based generateAliasAsModel

* [samples] Regenerate

* [rust] Generate as alias for all samples configs

* [csharp] Move test staged file changes to in-directory

* Include "live" test files and ignore test cache files from samples.ci

* Remove concept of samples.ci staging

Generators support .openapi-generator-ignore, allowing maintainers to
explicitly ignore the regeneration of files which have been modified.

Note that the tooling does not overwrite test files whenever those files
exist, and it's not entirely necessary to add test files to the ignore
file.

* Re-add meta generator scripts

* Modify ensure-up-to-date to log stdout, so script does not look like it hangs on slower machines

* [csharp] Regenerate sample

* Set generateAliasAsModel CodegenConfigurator#toContext

This ensures the property (which is effectively a thread-local) gets set
as expected if the caller resets GlobalSettings as is done in the
GenerateBatch command.

* [rust] Regenerate samples

* Re-enable elm

* [java] Support OffsetDateTime example, fail ensures script on any generation error

* [samples] Regenerate

* Fix jersey2-java8 ignore file

* Fix elm spec validation

* Force UTC in sample generation to avoid timezone conflicts during generation (user vs ci)

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-09 18:28:58 +08:00
Michele Mancioppi
765752f952
Add Instana to the list of users (#6584) 2020-06-09 18:15:23 +08:00
William Cheng
c176bdcb3e
[rust][reqwest] fix broken export (#6586)
* fix broken export

* add tests
2020-06-09 15:56:56 +08:00
dependabot[bot]
2c3721720e
Bump websocket-extensions from 0.1.3 to 0.1.4 in /website (#6578)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-07 19:32:21 -04:00
dumitru-petrusca
057c4294de
Issue 5497: Support the use of tags in the delegated Spring Kotlin generator. (#5499)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-06-07 19:24:20 -04:00
Michael Kreis
7baa72eefa
add use-site target field for JsonProperty annotation in kotlin data classes (#6186) 2020-06-07 19:23:15 -04:00
William Cheng
57d75e75e7
fix elm test spec (#6572) 2020-06-06 23:16:25 +08:00
Jim Schubert
835dab4b50
Fix typescript generator for parameter collectionFormat for pipes ssv (#6553)
Co-authored-by: David Biesack <David.Biesack@apiture.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>
Co-authored-by: Michele Albano <michele.albano@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2020-06-05 19:32:32 -04:00
Mateusz Szychowski (Muttley)
c102ced044
[C++][Pistache] Catch HttpError from user-provided handler (#6520)
* [C++][Pistache] Catch HttpError when user-provided handler has thrown

This allows for returning valid http code through exception

* [C++][Pistache] Update Petstore sample
2020-06-05 17:08:40 +02:00
Esteban Gehring
14642f1ee7 Merge remote-tracking branch 'origin/master' into typescript-refactor-master 2020-06-05 07:57:50 +02:00
William Cheng
d5ea62f966
remove scala related profile from the pom (#6554) 2020-06-05 13:51:11 +08:00