* Update ObjectSerializer.mustache
If the $data is a wrongly formatted Json or if data is not an array, php gives error:
Invalid argument supplied for foreach() at line 257 (Now line is 262)
* update samples
Co-authored-by: William Cheng <wing328hk@gmail.com>
* 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
* 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>
* [PHP] ObjectSerializer fix for array of objects
Array of objects translate to "map[string,object][]" and they fail to deserialize. This is because the deserialization does not parse the mapping string correctly. A quick fix is trying moving array deserialization before object deserialization.
Example object
ObjectExample:
type: object
properties:
data:
type: array
items:
type: object
additionalProperties: true
* Update sample
Co-authored-by: Alexandru Negrila <alex@arntech.ro>
* 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
* 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
* Example of broken multi-level hierarchy
* Support for multiple levels of hierarchy in model objects
* Support for multiple levels of hierarchy in generators
* Regenerated samples
* Temporarily skip scalaz sample verification, which is having issue with Java version in CI container
* Re-enable scalaz in verify samples
Co-authored-by: Rob Oxspring <roxspring@imapmail.org>
* [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