14237 Commits

Author SHA1 Message Date
William Cheng
7fbf262206 test run in docker script 2020-06-05 00:05:00 +08:00
Alexey Volkov
6f6c8ede79
[Python] Fixed docstrings in api.mustache (#6391)
* [Python] Fixed docstrings

Fixes https://github.com/swagger-api/swagger-codegen/issues/9630

* Updated generated files

* Fixed python-experimental

* Updated generated files

* Fully fixed the format of the docstrings

* Updated generated files

* Updated generated files in openapi3
2020-06-04 08:46:35 -07:00
Jiri Kuncar
e708cdc83e
[BUG][python] Support named arrays (#6493)
* [python] Support named arrays

* Fix named array type

* Use ModelSimple

* Reset samples

* Regenerated

* Animal farm test

* Array of enums

* Clean-up

* Clean-up

* Clean-up

* Fix array type generation

* simplify

* array model is not alias

* Array model has one value field

* ensure up-to-date

* ./bin/utils/ensure-up-to-date --batch

* Solve issue with missing import for array model

* regenerate
2020-06-04 07:50:53 -07:00
William Cheng
2be0afffe2
[Go] whitelist AdditionalProperties in the field name (#6543)
* whitelist AdditionalProperties in Go field name

* code format
2020-06-04 21:55:10 +08:00
Bruno Coelho
ae790ea74e
[kotlin][client] remove tabs usage (#6526)
* [kotlin] remove tabs

* [kotlin][client] update pet projects
2020-06-04 21:29:08 +08:00
William Cheng
176c439a6d
[PS] automatically derive discriminator mapping for oneOf/anyOf (#6542)
* infer mapping based on oneOf/anyOf schemas

* update files
2020-06-04 21:13:42 +08:00
Samuel Kahn
0f627e70fb
[C++][Ue4] various bus fixes (#6539)
* Fixed compilation on linux and UE4.23

* Added string and enum type definition support

* Better handling or variable names, should avoid conflicts with reserved keywords or empty variable names in edge cases

* Updated samples
2020-06-04 20:37:39 +08:00
Reijhanniel Jearl Campos
83a0f7d65b
Fix incorrect npx command (#6537)
The current `npx ` command says to use:

```
npx openapi-generator generate -i petstore.yaml -g ruby -o /tmp/test/
```

This however, pulls a similarly-named but different project: [zhang740/openapi-generator](https://www.npmjs.com/package/openapi-generator).

This commit fixes this, by using the appropriate package `@openapitools/openapi-generator-cli`
2020-06-04 20:24:51 +08:00
William Cheng
859e7f7228
update pester to 5.x (#6536) 2020-06-04 15:05:08 +08:00
William Cheng
b2c615b253 Merge branch 'master' of https://github.com/openapitools/openapi-generator 2020-06-04 11:50:34 +08:00
William Cheng
a25359e91c comment out openapi3 java jersey2-java8 tests 2020-06-04 11:46:16 +08:00
William Cheng
5cf4ee1de8
add additional properties support to powershell client generator (#6528) 2020-06-04 11:37:56 +08:00
William Cheng
a6bf956df5
[Go][Experimental] Support additionalProperties (#6525)
* support additonal properties in go

* support additonal properties marshal in go exp

* update go samples
2020-06-04 11:33:21 +08:00
sylvainmoindron
b2305d731c
#5476 [kotlin] [spring] fix swagger and spring annotation for defaultValue (#6101) 2020-06-03 22:36:21 -04:00
Jim Schubert
244683d46a
[samples] regenerate (#6533) 2020-06-03 21:28:25 -04:00
Jiri Kuncar
d07f459ce3
[python] Fix date-time parsing (#6458) 2020-06-03 21:26:30 -04:00
Dennis Melzer
e2e3405689
Register OAuth2ClientContext as bean (#6172)
* Register OAuth2ClientContext as bean

#6171

* Add tab

#6171

* Modify tests

#6171

* Add import for test

#6171

* Modify spring cloud async test

#6171
2020-06-03 15:36:19 +08:00
William Cheng
4d68953ded
[Go][Experimental] Fix discriminator lookup (#6521)
* bug fix, better code format

* update oas3 sample
2020-06-03 01:11:41 +08:00
Justin Van Dort
8fc7ec8458
Typescript-rxjs: print param name (#6368)
* Prints out the parameter name in throwIfNullOrUndefined

* Fixed misspelling

Co-authored-by: Justin Van Dort <justinvandort@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
2020-06-02 12:46:30 +02:00
William Cheng
66a3ec7cf0
add oneof discrimistrator lookup to go experimental (#6517) 2020-06-02 16:50:35 +08:00
William Cheng
c1cf63e81c
[PowerShell] Add useOneOfDiscriminatorLookup option (#6516)
* add useOneOfDiscriminatorLookup option

* update doc
2020-06-02 14:07:05 +08:00
William Cheng
0fbbbe8a95
add discriminator support to anyOf powershell client (#6512) 2020-06-02 10:55:56 +08:00
William Cheng
4c3eb0d973
[Go][Experimental] Add discriminator support to anyOf (#6511)
* add discriminator support in anyof

* update samples
2020-06-02 10:54:57 +08:00
Jim Schubert
58ed6afc0d
Update Generate.java (#6515)
Removed missed -D messages
2020-06-01 21:08:50 -04:00
William Cheng
f91a5f7108
Undo PR #6451 (#6514)
* Revert "Minor enhancement to Python client generator's code format (#6510)"

This reverts commit 3ddc78393cf936076778783a956db613b3a07812.

* Revert "[Python][Client] Fix delimiter collision issue #5981 (#6451)"

This reverts commit 6783b90fe230360c58b360817887f418475b745b.
2020-06-01 20:01:06 +08:00
William Cheng
3ddc78393c
Minor enhancement to Python client generator's code format (#6510)
* minor enhancement to python java class code format

* minor format python experimental
2020-06-01 00:36:18 -07:00
Justin Black
d8c422398e
[python-experimental] Quicken package loading (#6437)
* apis and models contains all apis and models, omits loading them in the package namespace

* Runs git add -a and commits it

* Fixes test_outer_enum.py

* Fixes test_fruit.py

* Updates test_fruit and test_mammal

* Fixes test_parent_pet

* Updates test_discard_unknown_properties.py

* Updates test_deserialization.py

* Updates v2 docs md files for apis + the readme

* Fixes v2 tests

* v2 doc updates

* Updates v3 docs

* Reverts python_doc_auth_partial.mustache

* Adds sys to v3 tests

* Adds FILES update

Co-authored-by: Justin Black <justinblack@justins-air.lan>
2020-06-01 00:25:37 -07:00
fullcircle23
6783b90fe2
[Python][Client] Fix delimiter collision issue #5981 (#6451)
* [python][client] Fix delimiter collision (#5981)

* [python][client] Fix delimiter collision (#5981) update samples

* [python][client] Fix delimiter collision (#5981) update samples

* [python][client] Fix convert to enum var name (#5981)

* [python][client] Fix convert to enum var name (#5981) update samples
2020-06-01 14:12:24 +08:00
William Cheng
15be875275
[Java][Jersey2] add petstore integration tests (#6508)
* add tests to jersey2 client

* remove import
2020-06-01 11:08:15 +08:00
Samuel Kahn
e3eb3c2f7d
UE4 client generator fixes (#6438)
* Added the possibility for a codegen to set the location of the generated model files, similarly to API files.

* Removed std::shared_ptr from the generated types. Types in UE4Codegen are handled as POD structs, not shared pointers.

* Fixed handling of body parameters as per the specification, the single body object is written directly as the payload.

* Fixed handling of files and binaries, if a field is both isFile and isBinary, file will take precedence.

* Updated cpp-ue4 client samples

* Fixed handling of enums in models

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-01 00:13:12 +08:00
Frieder Bluemle
a96e783f06
Fix docs typos (#6478) 2020-05-31 23:03:12 +08:00
Yuriy Belenko
39eb32ec27
[php-laravel] Show required PHP version in docs (#6502)
* Add required PHP version to readme

* Add requried PHP version to @phpdoc
2020-05-31 23:02:35 +08:00
Yuriy Belenko
5877e3001d
[php-lumen] Show required PHP version in docs (#6501)
* Add required PHP version to readme

* Add requried PHP version to @phpdoc
2020-05-31 23:02:17 +08:00
Sebastien Rosset
54e2574013
[Java][Jersey2] Fix typo and script, Log enhancements, HTTP signature, deserialization (#6476)
* 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

* fix typo in pom.xml

* fix duplicate jersey2 samples

* fix duplicate jersey2 samples

* fix duplicate artifact id

* fix duplicate jersey2 samples

* run samples scripts
2020-05-31 22:45:01 +08:00
Jim Schubert
7e5f720f20
Remove deprecations 5.0 (#6060)
* [breaking] Enforce vendor extension naming convention

* [breaking] Rename system properties to global properties

* [docs] Update site with global properties list and usage explanation

* Use proper vendor extension casing in all templates

* Set remaining vendor extensions to convention of lower kebab-cased with x- prefix

* [samples] Regenerate

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java

Before we were adding hasPathParams twice, once with !op.pathParams.isEmpty(), and then again with hasPathParams. This was probably caused by a mistaken merge.

This is causing the difference in samples

Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>

* [Samples] Regenerated!

* Fix -D conversion to additional-properties, missed in bat files

* JERSEY2 option changed

* [samples] Regenerate

* [scala][finch] Fix remaining vendor extensions format to conventino

* [scala] The -D option was replaced with --global-property

* [samples] Regenerate

* Fix -DskipFormModel usage which has been moved to --global-property skipFormModel=true

* [samples] Regenerate

Co-authored-by: Richard Whitehouse <richard.whitehouse@metaswitch.com>
2020-05-31 19:14:31 +08:00
Kamil Breguła
40a7e53b19
Improve handling spaces in example command (#6482) 2020-05-30 23:15:53 +08:00
William Cheng
6477a3c431 fix maven plugin snapshot version 2020-05-30 18:28:48 +08:00
William Cheng
5b6d12e15f
comment out erlang server test (#6499) 2020-05-30 17:50:51 +08:00
William Cheng
1efeb92f6b
Migrate Perl samples to use OAS v3 spec (#6490)
* update perl samples to use oas3

* test perl in travis ci

* fix uri query

* fix comment

* fix bearer token

* fix add pet

* update body to pet
2020-05-30 17:00:22 +08:00
Jim Schubert
a47e522fae
[core] Refactor templating management (#6357)
* [core] Refactor templating management

This refactors template management to get logic out of DefaultGenerator
and to provide a cleaner API to template search and read/compile.

Deprecates MockDefaultGenerator, which is not a mock and causes
in-memory retention of file contents. Maintainers should prefer
executing a "dryRun" with new DefaultGenerator(true) or do true
mock/spies if evaluating template intermediaries is truly necessary.
Tests may read written files with lower overhead than the in-process
retention of those bytes.

This attempts to maintain some compatibility with existing templating
adapter interfaces. Any breaking change here would be unintentional but
minimal effort to retarget the new interface.

* Tests for dry run file outputs

* Update API usage in Meta, test TemplateManager

* Wait on lastModified, lookup by filename in SpringCodegenTest

* Test DefaultGenerator + ignore file

* Move config.processOpenAPI in DefaultGenerator

* Fix wrong use of libraries templateDirector (java)

The samples scripts for Java incorrectly referenced the libraries
directories directly rather than the upper-level Java directory. This
was incorrect usage of template directories, because the generator
expects to be given the "language" directory and perform a lookup for
missing templates in the order:

* user defined libraries directory
* user defined language root
* embedded libraries directory
* embedded language root
* _common directory

This is incorrect in our samples scripts because a user or maintainer
has the expectation that any template change to files at the Java/ root
should also be honored on generation if the script specifies a custom
template directory.

* Fix handlebars extension usage, clean up Meta tasks

HandlebarseEngineAdapter previously didn't handle files without
extensions in the same was as the MustacheEngineAdapter. This now allows
for files without extension (or dotfiles) to lookup in the same
location.

Meta tasks are cleaned up to use template manager only, rather than
attempting to create an "empty" generator to use the previous templating
specific methods.

* Update kotlin-multiplatform gradle wrapper

* Rename GraphQL .gitignore template

The .gitignore file is unable to load via classpath resource from the
graphql node server resource directory (for unknown reasons). Before
this change, the missing template would fail silently.

A .gitignore file may exist in other directories and load as expected.
Added a default .gitignore to _common as a fallback so as not to break
any custom generators which may also be failing silently.

* Log entire stacktrace in go sdk built by gradle in AppVeyor

* Rename PHP .gitignore to gitignore

Java resources may not load .gitignore, this follows suit with other
generators and uses "gitignore" (some use "gitignore.mustache").

* [php] Rename .gitignore templates to gitignore

* Use same classpath lookup in common locator

* [rust] Properly escape empty triple-braces

* [samples] Regenerate
2020-05-30 00:19:03 -04:00
William Cheng
74584eb734
migrate apex samples to use oas3 spec (#6488) 2020-05-30 11:17:19 +08:00
William Cheng
5ef626be53 add new file in php-symfony sample 2020-05-30 10:24:40 +08:00
Ghufz
8480706da1
[PS] Refactor the http signing auth with ecdsa support (#6397)
* ValidatePattern having double quote(") throws exception on running Build.ps1

* fix tab with space

* [powershell-experimental] : http signature auth

* fix the tab issue

* merge cnflict fix for powershell experimental

* Htpp signing : added support for ecdsa

* Update modules/openapi-generator/src/main/resources/powershell/configuration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Update modules/openapi-generator/src/main/resources/powershell/configuration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Update modules/openapi-generator/src/main/resources/powershell/configuration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Update modules/openapi-generator/src/main/resources/powershell/configuration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Update modules/openapi-generator/src/main/resources/powershell/configuration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* HttpSigningHeader accepts any header available in request to calculate the signature.

* Update modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Incorporated the review comments

* addressed the merge conflict

Co-authored-by: Ghufran Zahidi <gzahidi@cisco.com>
Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2020-05-30 00:15:38 +08:00
Richard Whitehouse
82410ae90b
[Rust Server] Hyper 0.13 + Async/Await support (#6244)
* [Rust Server] Hyper 0.13 + Async/Await support

Upgrade dependencies to Hyper 0.13 and use async/await.

* [Rust Server] Add missing hyper-tls dependency

* [Rust Server] Add missing models import

* Update samples
2020-05-29 15:18:30 +01:00
William Cheng
c3ac84cec2
[Rust] set supportAsync to true as the default (#6480)
* set supportAsync to true

* set reqwest as the default lib
2020-05-29 21:18:15 +08:00
Yuriy Belenko
83bad102ea
[php-symfony] Set required PHP version ^7.1.3 (#6181)
* Set PHP 7.1.3 required version

I've tried to specify ^7.0 version at first, but main package which is
symfony/framework-bundle@v4.4.8 requires PHP ^7.1.3.

* Bump Symfony FrameworkBundle to ^4.4.8

Current Symfony Framework stable version is v5.0.8, but I guess it
requires significant codebase upgrade, so I've sticked with 4.4.8 which
shouldn't cause any breaking changes. Old requirement was ^3.3|^4.1
which compatible with 4.4.8.

* Bump PHPUnit version to ^7.0

PHPUnit 8.x version required PHP ^7.2, so I'm setting 7.x version to
support PHP 7.1.
There is new way to specify Kernel class, related PR:
https://github.com/symfony/symfony/pull/22668

* Bump PHP CS Fixer version to ^2.16.3

Configuration and all renamed rules fixed.
Config file renamed to .php_cs.dist as recommended in migration guide.
Migration guide from 1.x to 2.x:
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md#config-file

* Remove PHP_CodeSniffer package

Second linter doesn't make sense. I think Symfony user would prefer
PHP CS Fixer over PHP_CodeSniffer because first one maintained by Symfony
members.

* Remove satooshi/php-coveralls package from Composer

This package is abandoned and Coveralls recommends to install it directly
in Travis-CI task script.

* Update Travic-CI config

I've changed test versions to PHP 7.1.3 and 7.2. PHPUnit generates
coverage report in report/logs/clover.xml file. Then PHP CS Fixer runs
with --dry-run option to not override anything just to show coding style
errors.

* Add basic Coveralls config

This is basic recommended config for a PHP based project.

* Add symfony/yaml package

This package was part of satooshi/php-coveralls, now it should be
defined as dev dependency.

* Do not commit composer.lock

I think committed composer.lock can cause CI errors while tests on fresh
installs are better.

* Remove confusing Ruby comment
2020-05-29 18:35:11 +08:00
William Cheng
30caeedb98 update doc 2020-05-29 18:16:55 +08:00
Jim Schubert
cc59367909
[csharp] Rename netstandard to netstandard1.3 (#6460) 2020-05-29 17:32:52 +08:00
ShakedH
a64f547c2a
feat: support deprecated parameters for typescript-axios generator (#6475)
Add @deprecated to JSDoc for a parameter when it is marked as deprecated

Co-authored-by: Shaked Hazon <s.hazon@f5.com>
2020-05-29 08:14:54 +02:00
Jose Camara
3bf28be4bb
[REQ][typescript-axios] useSingleRequestParameter should mark parameter optional if all properties are optional (#6477)
* Include map for `AnyType` in `typescript`

* Exclude `any` from the list of types extracted from `anyOf`, `allOf`, `oneOf`

Exclude if there are other meaningful types

* Include new scripts and `yaml` to test the new case

* Execute the new sample for `typescript-axios`

* Filter out only `AnyType` instead of all `any` types

* Renamed and modified samples

- Included more examples using `oneOf, `allOf`, `anyOf`
- Includede examples when types that are translated to `any` are involved (`file`)

* Changes in mustache file

Set default value to empty object when the `requestParameter` doesn't have any required param

* New schema with operations without required params

* Generate the sample
2020-05-29 08:14:16 +02:00