8767 Commits

Author SHA1 Message Date
Sebastien Rosset
6c5621d97e
[Java] Enable discriminator recursive lookup (#5895)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* enable discriminator lookup

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Address Jim Schubert review comments

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

* Change discriminator CLI option. Remove exception when mappingName is null value

* resolve merge conflicts

* Execute scripts under bin directory

Co-authored-by: Justin Black <justin.a.black@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-13 01:02:55 +08:00
William Cheng
f8be3926f4
add null type support to oneof/anyof java jersey2 (#6269) 2020-05-13 00:46:53 +08:00
Mike Welsh
5f0e7e81b1
Unwrap the AnyHashable and use the base value in Models.mustache (#6241)
* Unwrap the `AnyHashable` and use the `base` value in Models.mustache

- Unwraps the `AnyHashable` base in `NSURLResponse.allHeaderFields` instead of the `AnyHashable` itself

* Update samples (just running the script)

* Update samples
2020-05-12 20:09:17 +08:00
William Cheng
deec5da8a7
[Java][jersey2] replace jersey2 with jersey2-experimental (#6251)
* replace jersey2 with jersey2-experimental

* better handling of oauth

* add jersey2 java8 samples

* add dependency to test pom

* fix test, update doc
2020-05-12 18:27:33 +08:00
sunn
1f82facf82
Fix datatypes in headers other than strings (#6233) 2020-05-12 08:51:24 +02:00
Sebastien Rosset
c1d47a580b
[codegen][Python-experimental] Discriminator NPE fix, handle 'null' type, #4906 enhancements (#5809)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Runs ensure up to date

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Fix NPE when at least one extension is defined but not x-discriminator-value

* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Add documentation and new getValidDiscriminatorMappings function

* Add documentation and new getValidDiscriminatorMappings function

* Add documentation and new getValidDiscriminatorMappings function

* Add documentation and new getValidDiscriminatorMappings function

* Add documentation and new getValidDiscriminatorMappings function

* Add documentation and new getValidDiscriminatorMappings function

* throw exception if discriminator mappingName argument is null

* handle scenario when composed schema has 'null' type

* remove extraneous characters in comments

* Uses df.isString

* Traverse discriminators to resolve discriminator mapping

* Fixes tests be correctly setting df.isString

* Remove unused method

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Remove exception when mappingName is null value

* Remove exception when mappingName is null value

* resolve merge conflicts

* resolve merge conflicts

* Execute scripts in the bin directory

* Fix CI issues and address PR review comments: better documentation and fix white space issues.

* Fix CI issues and address PR review comments: better documentation and fix white space issues.

* run sample scripts

* resolve merge conflicts

* fix end-of-line issue

* resolve merge conflicts

* resolve merge issues

* Handle case when discriminator is not specified in input data

* minor changes and add code comments

* Refactor get_discriminator code

* Add unit test with missing discriminator property

* improve get_discriminator function

* Run sample scripts

* add unit tests for recursive get_discriminator_class

* fix unit test issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix index out of range exception

* fix formatting issues

* fix formatting issues

* fix formatting issues. Finally figured out how to check formatting in local workspace

Co-authored-by: Justin Black <justin.a.black@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-11 16:57:49 -07:00
William Cheng
0d6f8763eb
add cookie auth support to csharp-netcore (#6254) 2020-05-12 00:35:38 +08:00
Sebastien Rosset
4488db60b3
[python-experimental] Improve error message for regex matching, add unit tests. (#6226)
* Improve error message

* Add unit tests for regular expressions
2020-05-11 18:18:34 +08:00
William Cheng
edb94f7ece
[Go][Experimental] better oneOf and anyOf implementation (#6166)
* diff oneOf implementation

* update oas3 samples

* fix imports

* remove commented code
2020-05-11 17:25:38 +08:00
William Cheng
d22bea216c
Add "useSingleRequestParameter" option to Rust client generator (#6230)
* add useSingleParameter option

* fix group parameter in rust reqwest

* rust-single-param
2020-05-11 15:27:59 +08:00
William Cheng
4effa739eb
Add AnyType support to Java generators (#6246)
* add anytype support to java

* fix test

* fix primitive type

* update tests

* update samples
2020-05-11 15:27:03 +08:00
Christophe Bornet
779b176648
Add full OAuth2 support to jersey2-experimental codegen (#6183)
* Add full Oauth2 support to Jersey client

* Regenerate jersey2-experimental sample

* Regenerate all java clients
2020-05-11 15:18:47 +08:00
Pierre-Yves FARE
3de587826a
Remove extra bracket in --http-user-agent example. (#6247) 2020-05-11 14:30:20 +08:00
DK99
5693cb9863
[c-sharp] generator added CancellationToken to async api calls (#6243)
* csharp generator CancellationToken added to async methods

* update samples
2020-05-10 23:55:48 -04:00
Roman Klevtsov
57c986f7fa
Do not reset templateDir in setAspnetCoreVersion (#6216) 2020-05-11 11:46:32 +08:00
Sebastien Rosset
fa37a696a8
[python-experimental] Raise builtin AttributeError instead of custom ApiKeyError (#6229)
* Use AttributeError instead of ApiKeyError because that's what the hasattr builtin function uses

* Use AttributeError instead of ApiKeyError because that's what the hasattr builtin function uses

* fix unit tests

* create ApiAttributeError exception

* fix formatting

* run samples scripts
2020-05-10 19:02:41 -07:00
Jesper Nysteen
7f58c57249
Fix locale issue for numeric string conversions (#6194)
* Fix locale issue for numeric string conversions

Using a generated C# client from an application with a locale that formats numbers with a comma as a decimal separator will make the client send invalid numeric parameters to the API. Any numeric parameter with decimals will added to the URL with a comma ('0,15' instead of '0.15'), potentially breaking the API integration.
In my specific use case, the API interpreted '0,15' as '15', resulting in pretty funky errors.

This commit ensures that parameters are parsed with the invariation culture, fixing the mentioned error.

* Add missing reference to System.Globalization

* Update ClientUtils.mustache
2020-05-10 22:41:03 +08:00
Sebastien Rosset
a093a9d5d5
[python-experimental] Make the array items attribute optional (#6133)
* Make the array items optional

* Handle any type schema

* Handle any type schema

* remove prefix and fullSuffix

* Remove prefix and suffix

* fix Java code comment

* Add code comments, use recursion for any type

* Address review comments
2020-05-09 18:49:10 -07:00
Falko Modler
3f174d8a30
[maven] Introduce addTestCompileSourceRoot (#6120) 2020-05-09 14:32:54 -04:00
David Lee
20931b1daa
Fix java-inflector to reference the correct openapi.yaml file (#6228)
java-inflector references wrong openapi file (swagger.yaml)
2020-05-09 21:53:16 +08:00
adg-mh
2b1bc73f03
Support responses which are binary files (#6201) 2020-05-09 14:34:03 +08:00
Yuriy Belenko
d2b925769e
Mark Silex server generator as deprecated (#6220)
Quote from Silex package on Packagist:
https://packagist.org/packages/silex/silex
WARNING: Silex is in maintenance mode only. Ends of life is set to June
2018. Read more on https://symfony.com/blog/the-end-of-silex.
2020-05-09 14:27:52 +08:00
William Cheng
d5304055ab
Minor improvements to the Lua client generator (#6219)
* minor improvement to lua client gen

* add new files
2020-05-09 14:26:54 +08:00
William Cheng
d6d241bdab
remove web.config (#6214) 2020-05-08 22:47:16 +08:00
William Cheng
f327f01c19
Replace powershell generator with powershell-experimental generator (#6213)
* replace powershell generator with powershell-experimental generator

* add back samples

* add back scripts

* remove outdated script

* update doc
2020-05-08 20:13:01 +08:00
Yuriy Belenko
8c6236b341
[php] Set required PHP 7.1 in code comments and readme (#6188)
* Bump PHP version to 7.1 in readme

* Bump PHP version to 7.1 in class templates

* Remove HHVM from Travis CI config

PHPUnit dropped support of hhvm, so build unlikely will pass tests.
https://github.com/sebastianbergmann/phpunit/issues/3320#issuecomment-426325646

* Remove sudo: false from Travis-CI config

Official doc recommendation:
https://docs.travis-ci.com/user/reference/trusty/#container-based-infrastructure

* Change tested versions to 7.1, 7.2 in Travis-CI

* Remove PHP_CodeSniffer from dev dependencies

There is another linter(PHP CS Fixer) which is fully configured while
CodeSniffer isn't configured at all.

* Use caret instead of tilde in dependencies

^2.12 equals (>= 2.12.0 && <3.0.0) while ~2.12 is (>=2.12.0 && <2.13.0)

* Refresh samples
2020-05-08 10:55:36 +08:00
Bruno Coelho
577ebb687e
[swift] remove urlsession kvo usage (#6211) 2020-05-08 10:13:13 +08:00
William Cheng
b23ec9a7dd
map any type in rust server generator (#6209) 2020-05-08 10:11:58 +08:00
Ghufz
13f329eafe
[powershell-experimental] : http signature authentication implementation (#6176)
* ValidatePattern having double quote(") throws exception on running Build.ps1

* fix tab with space

* [powershell-experimental] : http signature auth

* fix the tab issue

Co-authored-by: Ghufran Zahidi <gzahidi@cisco.com>
2020-05-07 22:46:40 +08:00
adg-mh
5f2270a0e8
Add missing AnyType type mapping (#6196)
Without the AnyType type mapping, the generated dart code uses `AnyType` instead of  `Object`, which does not compile.
2020-05-07 21:09:55 +08:00
William Cheng
fa8c9908be
Minor fixes post-release (#6204)
* minor fixes post release

* update gradle version

* comment out rust server test
2020-05-07 16:41:24 +08:00
William Cheng
98e54f0cc1 Merge remote-tracking branch 'origin/5.0.x' 2020-05-07 14:27:56 +08:00
Alofredo
3bfd6de327
[cpp][Qt5] Add the ability to pass QNetworkAccessManager as a parameter (#6053)
* [C++][Qt5] Add the ability to pass QNetworkAccessManager as a parameter
* connect to QNetworkReply::finished instead of QNetworkAccessManager::finished

* [C++][Qt5] regen samples for cpp-qt5-client

* [C++][Qt5] disconect from reply by timeout

* [C++][Qt5] regen samples for cpp-qt5-client

Co-authored-by: alfredotg <alfredotg@tu.ru>
2020-05-07 08:05:29 +02:00
Vikrant Balyan
9e8cc284e0
adds the missing typeMapping for AnyType (#6199) 2020-05-07 11:55:55 +08:00
Richard Whitehouse
046b4acdff
[Rust Server] Support boolean headers, and fix panic handling headers (#6056)
* [Rust Server] Support headers containing booleans

* [Rust Server] Fix panic handling headers

* [Rust Server] Fix issue with Results

* Update samples
2020-05-06 19:27:52 +01:00
William Cheng
1d606499ee Merge remote-tracking branch 'origin/5.0.x' 2020-05-06 22:51:05 +08:00
William Cheng
003165c2c2
Prepare 4.3.1 release (#6187)
* prepare 4.3.1 release

* update doc
2020-05-06 17:10:31 +08:00
Luis Ballabeni
30ee3f343e
Fix #6157: Updated native template to fix null async return (#6168)
* Fix #6157: Updated native template to fix null async return

Should fix issue: https://github.com/OpenAPITools/openapi-generator/issues/6157

* fixed uncaught json exception in java native api gen

* cleaning up

Co-authored-by: Luis Ballabeni <luis.ballabeni@lexisnexis.com>
2020-05-05 13:40:22 +08:00
Yuriy Belenko
90ff4926b9
Show description when summary is missing (#6159) 2020-05-05 11:23:59 +08:00
Sebastien Rosset
a58441cf68
Make the array items optional (#6132) 2020-05-04 20:31:55 +08:00
William Cheng
b369f9bfea
fix bearer auth in c# netcore async call (#6136) 2020-05-04 14:28:54 +08:00
William Cheng
138276a7c4
skip web.config for aspnetcore 3.x (#6147) 2020-05-04 10:45:02 +08:00
Justin Black
cbc006a938
Adds memoization and deserialization through 2 or more discriminators (#6124)
* Adds cached_property decorator, adds feature to move through n discriminators

* Adds v3 sample with 2 discriminators

* Adds tests of Shape, Tringle, and Quadrilateral traveling through 2 discriminators

* Adds test_deserialization.py:test_deserialize_shape

* Simplifes XTriangle sample spec schemas

* Simplifies Shape schema definition, updates go+python-experimental samples

* Fixes python-experimental test_dog tests

* Separates off python-experimental spec
2020-05-03 11:44:04 -07:00
Paul Hatcher
e4cbaa721b
Implement Asp.Net Core 3.0/3.1 generator (#6009) (#6025)
* Minor changes to 2.1 templates to make them work or improve documentation

* Support for ASP.NET Core 3.0 and 3.1

* Update aspnetcore test scripts and results

* Update generated documentation

* update doc

* Update modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache

Co-Authored-By: Tatsuro Shibamura <me@shibayan.jp>

* Update modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache

Co-Authored-By: Tatsuro Shibamura <me@shibayan.jp>

Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Tatsuro Shibamura <me@shibayan.jp>
2020-05-03 16:32:26 +08:00
Ukonn Ra
f4fa00fefa
Add async native Java Client (#4721)
* Add async native Java Client

* UPDATE: Reformat the samples

* test java native async in drone.io

* update test count

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-03 16:06:18 +08:00
minenok-tutu
cd88c06372
File return type fix (#5644)
* file return type fix

* Update client.mustache
2020-05-03 12:21:22 +08:00
Sebastien Rosset
afa66f858b
fix documentation (#6131) 2020-05-02 23:48:43 +08:00
Sebastien Rosset
77d6c04b24
[Java] Enhancements for HTTP message signature (#6090)
* Add code comments

* Change 'setup' method to setPrivateKey

* Add support for configuring digest algorithm

* run script in bin directory

* format generated code

* Revert "format generated code"

This reverts commit 3b527784375bcf86cacf75bd0142f63b91c96ff8.
2020-05-02 23:31:45 +08:00
Aleksandr Nekrasov
03c3c64d23
[scala][akka-http] fix non-default packages for api, model and invoker (#6129)
* [scala][akka-http] fix non-default packages for api, model and invoker

* remove default invoker additionalProperty

* fix invoker package for scala-akka and sttp

* fix invoker package and settings for scala-akka

* fix tests compatible with windows paths

* test output

* test output

* fix base output path for test

* fix output path for test

* fix sttp invoker package
2020-05-02 21:49:34 +08:00
Tatsuro Shibamura
973258912c
[csharp-netcore] Fixed handling of nullable enum values (#6112)
* [csharp-netcore] Fixed handling of nullable enum values

* Update sample code

* Remove unnecessary method calls
2020-05-02 21:39:24 +08:00