163 Commits

Author SHA1 Message Date
William Cheng
bcefbe99c1
Migrate PHP client samples to use OAS v3 spec (#6722)
* consolidate php samples

* restore EnumTestTest.php
2020-06-22 16:56:03 +08:00
Yuriy Belenko
4f1d7c0f04
[php] Set required PHP version to 7.2 (#6603)
* Set PHP 7.2 as minimum version

* Update PHPUnit to 8 || 9

* Set Bionic environment in Travis config

* PHPUnit 8 requires void return in static methods

* PHPUnit 8 requires void return in static methods

* Fix curl exception message test

When I run "curl http://wrong_host.zxc" output is:
curl: (6) Could not resolve host: wrong_host.zxc
Maybe this message is different across versions.

Tested curl version:
curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1

* Update assertions of deprecated assertInternalType

* Migrate to expectException method of PHPUnit 8

* Fix PHPCS Fixer errors

* Replace deprecated 'assertRegExp' assertion

* Exclude PHPUnit and php-cs-fixer cache

* Refresh samples

* Set root Travis CI environment to PHP 7.2.5

* Change to 7.3 as 7.2.27 is highest preinstalled

* Fix testWrongHost test
2020-06-14 22:41:03 +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
Jim Schubert
70ca93570e
[core][general] Add metadata file tracking to aid in "Golden Tests" regeneration (#6325) 2020-05-22 16:48:32 -04:00
William Cheng
d4b55d6767 update php petstore oas3 samples 2020-05-18 17:27:46 +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
William Cheng
46216cd796 Merge remote-tracking branch 'origin/master' into 5.0.x 2020-04-28 20:35:28 +08:00
William Cheng
588023686a
Add HTTP signature authentication support to Java (jersey2-experimental) (#6058)
* add fmt-maven-plugin to jersey2 exp

* update samples

* add http signature auth template

* minor fix

* fix http beaer auth, update sample

* fix http signature auth

* fix http signature auth

* header support

* add query string to path

* undo changes in default codegen

* ignore fake test

* add serialize to string method

* add serialzie to string method

* add get mapper

* auto format java source code

* remove plugin

* update pom.xml

* change back AbstractOpenApiSchema to T

* skip mvn code formatter in bin script

* undo changes to spec

* update samples

* add back HttpSignatureAuth.java
2020-04-28 00:09:30 +08:00
William Cheng
cef5470ea8
Add Http signature authentication test to fake petstore spec (#6054)
* add endpoint to test http signature

* update plugin version
2020-04-25 23:39:41 +08:00
William Cheng
5a9b0fcf9e update samples 2020-04-21 02:22:55 +08:00
William Cheng
faf6f197be Merge remote-tracking branch 'origin/master' into 5.0-sync-master 2020-04-17 15:51:00 +08:00
William Cheng
a0ca253218
update samples (#5722) 2020-03-27 13:55:55 +08:00
William Cheng
1065595a9a
Fix integration tests (Travis, CircleCI) (#5672)
* fix php tests

* fix scala tests

* update ts angular v6 rest

* fix user create test

* fix spring cloud test

* comment out user delete

* fix angular v7 tests

* fix user test

* fix tests

* fix go exp tests

* commented out delete user tests

* comment out delete user tests in go openapi 3

* fix clojure tests
2020-03-23 14:01:12 +08:00
William Cheng
3588990a4f
[PHP] complete support for form style (#5519)
* [BUG][PHP] Parameter property style not fully implemented (related to comment on PR #3984)

* [AUTOGENERATED][PHP] Sample Files
2020-03-05 22:20:59 +08:00
William Cheng
6db09f40be
[php] replace $collectionFormat with $style (#5517)
* php - remove $collectionFormat

* update php openapi3 petstore sample
2020-03-04 15:54:44 +08:00
copypasta-g
3e5fb670e2
fix(php): no need to serialize collections, Guzzle does that, fix #2292 (#3984)
* fix(php): only serialize collections if !explode, Guzzle handles the rest, fix #2292

* fix(php): update petstore samples

Co-authored-by: Mahdi Dibaiee <mdibaiee@pm.me>
2020-03-04 10:23:30 +08:00
William Cheng
165a9e0508 Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-20 20:52:27 +08:00
William Cheng
531dc30917 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-20 20:38:49 +08:00
Roland Franssen
0ffb99a48e [PHP] Preserve JSON accept header (#4684)
* [PHP] Preserve JSON accept header

* recompile php client

* revise

* recompile
2019-12-13 17:14:18 +08:00
William Cheng
466a67c9bc Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-12-12 17:27:49 +08:00
William Cheng
3e34903042 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-12-11 15:44:50 +08:00
Roland Franssen
b19d241be7 [PHP] ensure rewound guzzle response body (#4744)
* [PHP] ensure rewound guzzle response body

* recompile php client
2019-12-10 21:52:36 +08:00
William Cheng
11c7007429
Prepare v4.2.3 (#4663)
* update version

* update doc

* update samples
2019-12-02 15:26:01 +08:00
William Cheng
7aeab0219c Merge remote-tracking branch 'origin/4.3.x' into 5.0.x 2019-11-23 11:37:54 +08:00
William Cheng
fffe7c8a83 update samples 2019-11-23 00:24:50 +08:00
William Cheng
275d1db2e5 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-11-22 23:15:12 +08:00
William Cheng
ac8b96b972 update samples without batch mode 2019-11-21 17:13:30 +08:00
William Cheng
4ed742b6bc update samples 2019-11-21 15:24:13 +08:00
William Cheng
facabd4472 Merge branch '4.3.x' into 5.0.x 2019-11-21 15:19:31 +08:00
Hinrik Örn Sigurðsson
eebad5c9aa [PHP] Include microseconds in serialized date-time (#4542)
* [PHP] Include milliseconds in serialized date-time

* Add setDateTimeFormat()
2019-11-21 10:21:27 +08:00
William Cheng
60f4de0f22 Merge remote-tracking branch 'origin/master' into 4.3.x 2019-11-20 18:15:22 +08:00
William Cheng
f07b3e0521
Prepare 4.2.2-SNAPSHOT (#4497)
* update to 4.2.2-SNAPSHOT

* update doc

* update samples

* skip ocaml test

* update version

* fix version
2019-11-15 21:34:25 +08:00
William Cheng
4824bb7711 sync master, update samples 2019-11-04 09:28:19 +08:00
William Cheng
47e2c0d027
update samples (#4334) 2019-10-31 13:31:49 +08:00
wing328
54151891cc Merge branch 'master' into 5.0.x 2019-10-17 11:18:57 +08:00
William Cheng
cf38c56aa6
Fix readonly with isReadOnly (#4102)
* fix readonly

* update samples
2019-10-09 15:16:22 +08:00
William Cheng
8f86f0f04a Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-10-08 21:21:04 +08:00
William Cheng
d4500b307f Merge remote-tracking branch 'origin/master' into 4.2.x 2019-10-04 15:02:58 +08:00
Hinrik Örn Sigurðsson
60567bddd6 [PHP] Correctly format JSON in headers (#4024)
* [PHP] Correctly format JSON in headers

`ObjectSerializer::toHeaderValue()` in the generated PHP code calls
`toString()` on the values, which formats JSON with the `JSON_PRETTY_PRINT`
option. This will result in a multi-line header which cannot be parsed
since linebreaks aren't allowed by RFC 7230.

In my case I have a header schema called `UpdateUser` which I had hoped
would be serialized as `{"type":"staff","id":123}`.

Every single `__toString()` in the generator does the same thing, so I
figured it's safe to change `toHeaderValue()` to convert to JSON directly,
without `JSON_PRETTY_PRINT`. This fix works for me.

* More sensible approach to providing a header value

* Just strip the newlines

* Go back to previous solution
2019-10-03 20:38:15 +09:00
William Cheng
5eb67d471b Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-09-22 21:00:38 +08:00
William Cheng
3019b5a5e1 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-09-22 14:18:07 +08:00
William Cheng
ea029b4029
update doc, samples (#3875) 2019-09-11 21:17:11 +08:00
William Cheng
3ebefccfa9
Prepare v4.1.2 release (#3873)
* update samples

* update date
2019-09-11 18:33:27 +08:00
Quim Muntal
8f13b88ed9 Support custom git repository (#3757)
* add gitHost param to GeneratorSettings and related

* parameterize gitHost in READMEs

* parameterize gitHost in go.mod

* parameterize gitHost in git_push

* update petstore samples

* run ./bin/utils/export_docs_generators.sh

* run meta-codehen.sh

* Revert "run meta-codehen.sh"

This reverts commit d6d579f6159186531257cdfdd73b9caf9e9ffeba.

* Revert "run ./bin/utils/export_docs_generators.sh"

This reverts commit 1b81538198d4319fd1b4e97447303e3cc0e8dc99.

* Revert "update petstore samples"

This reverts commit f513add88396707f6991ae2e4920359583ec88f1.

* run ensure-up-to-date
2019-09-03 21:35:49 +08:00
William Cheng
a8fe5d355c Merge remote-tracking branch 'origin/4.2.x' into 5.0.x 2019-08-29 14:48:00 +08:00
William Cheng
9182784955 Merge remote-tracking branch 'origin/master' into 4.2.x 2019-08-28 14:01:20 +08:00
William Cheng
d0d545bbdd
Prepare 4.1.2 snapshot (#3758)
* update pom

* update samples

* update ts axios samples
2019-08-26 22:13:12 +08:00
William Cheng
c3535cf9ca
Add test cases to cover different collection formats (#3640)
* add test cases to cover different collection format

* add space params to retrofit 1.x

* add space params to retrofit 2.x

* rename url to localVarUrl

* fix exception in haskell servant
2019-08-15 11:09:12 +08:00
William Cheng
01222268e8 update samples 2019-08-11 18:56:47 +08:00
William Cheng
5956569e7a
Prepare 4.1.1-SNAPSHOT (#3603)
* update pom

* update samples

* update pom
2019-08-10 09:41:08 +08:00