2070 Commits

Author SHA1 Message Date
William Cheng
1f95199f82
update spring config to use java8 (#7308) 2020-08-28 19:17:20 +08:00
William Cheng
26c17c5774
[Java] remove deprecated jackson classes (#7304)
* [java/resttemplate] Generate valid code if no Authentication implementations present

Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods

* parameterize formParams

fixes #5782

* replace use of ISO8601DateFormat and ISO8601Utils with StdDateFormat

fixes #5779

* add constructor to intialise calendar

* Revert "[java/resttemplate] Generate valid code if no Authentication implementations present"

This reverts commit 6e450907bae1d831a4a8c9b66f6b707424f0a39a.

* Revert "parameterize formParams"

This reverts commit 7a26ce5dd21ce147ed33728cd0091a29175367a4.

* also override single arg parse method to avoid throwing exception

* also override single arg parse method to avoid throwing exception

* update samples

* update samples

* fix jersey1 tests

* fix jersey2 test

* update resteasy dependencies

* fix java jersey2 oas3 tests

* use java8 in springboot-beanvalidation

Co-authored-by: Jon Freedman <jon.freedman@zoho.com>
2020-08-27 23:13:56 +08:00
Niels Pardon
d868fd6dc8
[Java][clients] remove java.lang prefix from Object (#6806) 2020-08-24 22:06:19 -04:00
Oleh Kurpiak
8bd2dd4c9d
[Java] [Spring] Spring new mapping annotations (#7189)
* Spring new mapping annotations

* update other spring mvc templates
2020-08-24 17:03:21 +08:00
Jim Schubert
da84d8e3bf
[core][bug] FILES is now path relative with no prefixes (#7271)
* FILES is now path relative with no prefixes

some Java implementations don't honor .relativize documentation fully.
When outDir is /a/b and the input is /a/b/c/d, the result should be c/d.
Some implementations make the output ./c/d which seems to mix the logic
as documented for symlinks. So we need to trim any / or ./ from the start,
as nobody should be generating into system root and our expectation is no ./

This resolves regeneration issues for those on such Java
implementations, although we've not been able to track down the exact
vendor or configurations which might lead to these differences.

* Ensure windows outputs FILES paths in same format

* Normalize FILES paths to remove relativization mid-path
2020-08-22 15:49:00 -04:00
Yuriy Belenko
9a03850828
[php] Exclude composer.lock in root gitignore (#7224)
* Add samples composer.lock to root .gitignore

composer.lock may produce CI errors when you need to test build against
different PHP versions. However users most likely want to commit this
file, so I think it's better to exclude it only in root .gitignore.

* Commit composer.lock in default PHP templates

* Refresh samples
2020-08-17 00:13:50 +08:00
Jean-François Côté
14c14bf9a2
[Play Framework] Update minor version + scala version + swagger-ui version (#7200)
* Update play framework minor version + scala + swagger-ui + Remove bugs in the url of swagger-ui.

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-15 17:25:30 +08:00
ryutah
b3b4526bf7
[go-server] Modified go-server templates to allow services to receive http request's context. (#7214)
* adds context arguments to go-server templates (#6657)

* updates go-api-server samples (#6657)
2020-08-15 00:11:44 +08:00
Oleh Kurpiak
c9939a2754
[REQ][Java] Additional annotations with String params (#7117)
* Additional annotations with String params

* Additional annotations with String params. Missed sample update

* Additional annotations with String params. Use Jackson annotations

* insert unescaped content

* fix imports

* fix imports
2020-08-12 16:31:03 +08:00
beytun
a1484dac77
[Java] Update templates not to add @Pattern on byte array property (#7153)
* Update Java templates to skip generating @Pattern on byte array properties

* Revert separator changes

* Revert separator changes
2020-08-12 14:29:50 +08:00
Vincent Leon
930c622d11
Issue #6830: Java server - Add getter to ApiException templates (#7150) 2020-08-09 18:17:51 +08:00
William Cheng
57ee092abd update samples 2020-08-06 18:55:21 +08:00
devhl-labs
159936d85a
[csharp-netcore] renamed async methods to end with async (#7062)
* renamed async methods to end with async

* update samples

* updated samples

* updated test to use new name

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-06 18:49:53 +08:00
William Cheng
5ad2c8315e update samples 2020-08-06 17:33:32 +08:00
debugman
742b8bd650
added int32 support for go-server (#7123) 2020-08-06 17:17:07 +08:00
Yuriy Belenko
ba8a50137a
[php-lumen] Set required PHP version to ^7.2.5 (#6949)
* Set required PHP version to ^7.2.5

* Write .gitignore into srcBasePath

* Update dependencies

* Copy latest Lumen sources to templates

* Add Lumen license template

* Use Lumen license in templates

* Fix typo in readme

* Add Init App Config readme section

* Add composer.lock to root gitignore

* Add Travis-CI task

* Set OAS 3.0 input spec file for samples

* Refresh samples
2020-08-04 10:33:10 +08:00
Yuriy Belenko
6a08ec59c0
[core] Add type and format properties to model of inline response (#6153) 2020-08-03 18:37:37 -04:00
Sshnyari
1ffe2a780a
[aspnetcore] Typo issues in docs and generated code (#7094)
* fixed a typo issue in aspnetcore generator #4829

* solved an issue with integration tests using WebApplicationFactory

* updated aspnetcore samples impacted by the change
2020-08-03 21:26:40 +08:00
Dragos CIULICA
86eb1b9112
Bugfix/5.0.0 beta/6853 fixed reactor conditions in template (#6993)
* fixed flux<part> generation

* updated petstore samples

* fixed flux<part> generation

* updated petstore samples

* update samples

Co-authored-by: Dragos CIULICA <atlassian-masernet@bit-factor.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-07-28 16:02:08 +08:00
William Cheng
08612d8e52
fix string comparison in java pkmst generator (#7050) 2020-07-26 23:14:28 +08:00
Kim T
383b1e9db8
[NodeJS] nodejs-express-server fix /api-docs path (#6977) 2020-07-20 18:57:50 +08:00
William Cheng
dd6e8ccc3d
replace ~ with $user.home (#6985) 2020-07-18 17:07:03 +08:00
William Cheng
0707b4bb20
[Scala] setup Ivy cache directory (#6978)
* use ivy2 cache

* use ~/.ivy2 cache dir

* add pom.xml to openapi-generator-ignore

* update scala-akka sample

* use ~ for home directory
2020-07-18 15:48:47 +08:00
William Cheng
c6cb7ebe2a
mark python2 support in flask as deprecated (#6653) 2020-07-02 15:16:53 +08:00
Yuriy Belenko
6224f5e397
[php-ze-ph] Set required PHP version to ^7.2 (#6763)
* Bump required PHP version to ^7.2

* Update required PHP version in readme

* Change samples input spec to OAS 3.0

* Refresh samples
2020-07-01 15:11:34 +08:00
Chris Tankersley
d433c2d42f
[php-laravel] Upgrade php-laravel to 7.x (#6346)
* Update laravel from 5.6 to 7.0

* Updated petstore example, removed missing files

* Updated PHP version to match composer.json

* Add samples generation config with OAS3 input spec

* Fixed gitignore compile errors, updated to newest petstore example

* Add composer.lock to .gitignore

* Fix generator gitignore location

* Add integration tests

* Refresh samples

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2020-06-30 12:22:32 +03:00
William Cheng
0cf31704cc
remove silex samples, config (#6736) 2020-06-22 11:01:43 +08:00
William Cheng
11f0b3d39f update php slim4 samples 2020-06-21 23:06:13 +08:00
Yuriy Belenko
e49804fd7f
[php-slim4] Move Data Mocker to external repo (#5930)
* Remove package from sources

* Add Mocker package

* Add BaseModel

Beside setters and getters this class implements three methods required
for mocking: getOpenApiSchema, createFromData and jsonSerialize.

BaseModel keeps all data values in $dataContainer like PHP client does.
I don't see other way to support scalar models(enum for instance).
That's why I've removed class variables generation.

* Update documentation

* Update PHPUnit section in readme

* Add constant with models namespace

This constant will be required for data deserialization when handling
refs.

* Refresh samples

* Add samples generation config
2020-06-21 22:16:44 +08:00
sunn
efafc58170
The templateDir for aspnet is not set correctly (#6724) 2020-06-21 18:52:29 +08:00
William Cheng
155acae088
remove php slim samples, config (#6721) 2020-06-21 14:35:36 +08:00
YishTish
5cdc9e9e35
Pass body to service (#6041)
* Fixed a bug where request body names were not being transferred appropriately based on openapi definitions

* Added changes made to output samples

* Fixed formatting on Controller.mustache

* Added sample code generated after last change
2020-06-19 20:44:08 +08:00
wing328
748190a049 update samples 2020-06-16 11:24:56 +08:00
Nikita Karnaukh
53eff43184
[Kotlin][Client] Fix url path for Retrofit, Fix optionals for @Query @Body, Set List as default collection for Kotlin data class (#6456)
* Replace typeMapping kotlin.Array with kotlin.collections.List, because its doesn't work with Kotlin Data Classes(required manually implementing  hashCode&equals)
Replace typeMapping kotlin.Array<kotlin.Byte> with efficient primitive implementation kotlin.ByteArray
Replace instantiationTypes array to kotlin.collections.ArrayList, for extending Array we should provide element count to its constructor.

* Fixed path(removed slash on begin path) for Jvm Kotlin Retrofit

* Fixed handling optional bodyParams for Jvm Kotlin Retrofit

* Fix kotlin tests

* Fixed code format for detekt inspections #2

* revert formatting

* Added ability to generate optional @Query params.

* Update Kotlin docs.

* Update Kotlin openapi3 client samples

* Update Kotlin client samples

* Update Kotlin openapi3 client samples after merge with master

* Revert hardcoding List instead Array

* Set List as default collectionType

* Update Kotlin samples

* Fixed Kotlin multiplatform api template. fix mapper for Array type.
Fixed Kotlin multiplatform api template Code style.

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform template code style

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform converting Array to List in Api.

* Update Kotlin multiplatform sample #3

* Fix Kotlin tests

* Fix Kotlin jackson Application.kt

* Fix Kotlin tests #2

* Fix merge conflict with master

* Generate samples after merge with master

* Generate samples after merge with master #2

* Generate samples after merge with master #3

* Generate samples after merge with master #4

* update kotlin samples

* update all samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-16 10:33:34 +08:00
Richard Whitehouse
c094effd90
[Core, Rust Server] Support JSON query parameters (#6577)
* [Core] Record content type for parameters

* [Rust Server] Support query parameters in JSON

* [Rust Server] Add test for JSON query parameter

* Update samples
2020-06-15 23:06:03 +01:00
Richard Whitehouse
45655c2235
[Rust Server] Support arrays within additional properties (#6576)
* [Rust Server] Support arrays within additional properties

* [Rust Server] Add test for additional properties with lists

* Update samples
2020-06-15 23:05:35 +01:00
Richard Whitehouse
3ba787c5aa
[Core, Rust Server] Support optional headers (#6575)
* [Core] Set whether a header is required

* [Rust Server] Support optional headers

* [Rust Server] Add test for required header

* Update samples
2020-06-15 23:05:11 +01:00
Richard Whitehouse
c65363eb71
[Rust Server] Pass context to client middleware (#6574)
* [Rust Server] Pass context to client middleware

When creating a client with middleware, pass the context.

This allows users to pass contextual data about the requests through to the
client middleware.

* Update samples
2020-06-15 23:03:25 +01:00
Yuriy Belenko
e282a052bf
[php-slim4] Set required PHP version to 7.2 (#6530)
* Bump required PHP version to 7.2

* Update rest dependencies to meet php 7.2

Latest phpunit 9 requires PHP 7.3, so I've set phpunit 8 as a fallback.

* Fix TestCase inheritance

* Add phpunit cache file to gitignore

* Put license @phpdoc into separate mustache

* Bump readme PHP version to 7.2

* Bump @phpdoc PHP version to 7.2

* Update Zend Diactoros with suggested package

* Refresh samples

* Remove broken tests

These tests will be fixed in next PR which moves Mock feature to
external repo.

* Point root Travis CI environment to PHP 7.3
2020-06-14 22:40:06 +08:00
Yuriy Belenko
90f904a669
[php-slim4] Throw specialized HttpNotImplementedException (#6544)
* Use HttpNotImplementedException from Slim

Specialized HttpNotImplementedException from Slim makes possible to
distinguish general exceptions from case when implementation isn't
complete. This update doesn't change API call results.

* Refresh samples
2020-06-14 17:26:20 +08:00
Yuriy Belenko
c7de5e2268
[php-slim4] Mark generated tests as incomplete (#6541)
* Mark generated unit tests as incomplete

PHPUnit has special "markTestIncomplete" method which is perfectly fits
our generation flow.
Ref: https://phpunit.readthedocs.io/en/7.0/incomplete-and-skipped-tests.html

* Refresh samples
2020-06-14 17:23:17 +08:00
Jochen Schalanda
32adeddd8f
Fix usage of javax.annotation (#6645)
* Fix usage of javax.annotation:javax.annotation-api

* Regenerate samples

```
bin/generate-samples.sh bin/configs/java-* bin/configs/jaxrs-* bin/configs/spring-* bin/configs/kotlin-* bin/configs/other/java-* bin/configs/other/jaxrs-* bin/configs/other/kotlin-* bin/configs/other/openapi3/jaxrs-cxf-client.yaml bin/configs/other/openapi3/kotlin-*
```
2020-06-14 17:01:18 +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
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
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
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