200 Commits

Author SHA1 Message Date
William Cheng
807250a430
Prepare 7.6.0 (#18412)
* Revert "v7.5.0 release"

This reverts commit 1eafe2aebf33b13bee0ead66d62a6436e7db059d.

* update master to v7.6.0 snapshot

* update readme

* update samples
2024-04-17 19:05:37 +08:00
Daniel Metzner
8155d03c38
Allow Symfony 7 / Remove EOL PHP / Bearer Fix (#18357)
Bump requirements
  - add Symfony 7 support
  - remove support php < 8.2 (EOL)
  - remove symfony < 6.4 support

Bug Fix
  - add missing $security{{name}} variable when using Bearer Auth

Misc
 - getContentType method is deprecated; use getContentTypeFormat
 - use match instead of switch for simple assignments
 - remove default depth param from json_encode call
 - make data provider static (phpunit)
2024-04-13 10:46:47 +08:00
William Cheng
4ff7e0ec3f
Prepare 7.5.0 snapshot (#18068)
* Revert "7.4.0 release"

This reverts commit eda049348425171df772a7b9087cc97db718cfda.

* prepare 7.5.0 snapshot version

* update samples

* update doc
2024-03-11 11:10:52 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
Simon Podlipsky
1e9bccca16
feat: generate EOL in VERSION file (#17829)
The EOL is missing so let's add it in order to comply with POSIX standard:

Line
> A sequence of zero or more non- <newline> characters plus a terminating <newline> character.
2024-02-12 15:40:55 +08:00
William Cheng
783e68c7ac
7.4.0 snapshot (#17818)
* Revert "7.3.0-release (#17817)"

This reverts commit d617b46c86b9075c5e0d63fe3798e2982f5259ac.

* update samples, docs, readme
2024-02-08 16:07:22 +08:00
William Cheng
5eab3cef19
Prepare 7.3.0-SNAPSHOT (#17456)
* Revert "v7.2.0 release (#17455)"

This reverts commit fe638d009363c142c246ff089032f243e0b4ee01.

* set version to 7.3.0-SNAPSHOT

* update doc
2023-12-22 16:55:58 +08:00
William Cheng
391df3b81c update samples 2023-12-05 15:36:33 +08:00
William Cheng
53289263d9
Prepare v7.2.0 (#17050)
* update version to 7.2.0-SNAPSHOT

* update samples

* update doc
2023-11-13 18:53:20 +08:00
loicconan
d945499073
[PHP-SYMFONY] Support BackedEnum for enum ref (16846) (#16847)
* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enumm ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)

* [PHP-SYMFONY] Support BackedEnum for enum ref (16846)
2023-11-07 22:40:35 +08:00
Artem
05b796aadc
Fix type hint for array in comments. (#16926) 2023-10-28 20:30:16 +08:00
loicconan
cb85358aa5
[PHP-SYMFONY] Debug Date and DateTime Assert (#16874) 2023-10-23 22:26:27 +08:00
DaxServer
8bb473316e
[PHP-Symfony] fix #15950: Add float to deserialize (#16835)
* [PHP-Symfony] fix #15950: Add float to deserialize

* Add test sample

* Add double

---------

Co-authored-by: DaxServer <daxserver@icloud.com>
2023-10-16 22:19:33 +08:00
Artem
039c1698b0
[php-symfony] Support for default scalar value of properties in model (#16605)
* Add support for default scalar value of properties in php-symfony models. Default values now returns in getter-functions

* Revert nullable type-hinting. Move default values from getter to property initialize.
Made changes in __construct:
Now value of properties rewrites only if key exist in $data array.
2023-10-01 21:32:32 +08:00
William Cheng
5e8e2d7f6d
Prepare v7.1.0 in master (#16608)
* prepare v7.1.0 in master

* update
2023-09-18 17:37:36 +08:00
William Cheng
80121aa88f
Prepare v7.0.1 (#16409)
* prepare 7.0.1 in master

* update doc
2023-08-25 16:11:29 +08:00
Guillaume Turri
20d1743a36
Fix parsing of Accept header like '*/*;q=0.8' (#16169)
This fixes #15043

The issue is that browsers like "text/html,...,*/*;q=0.8" (see for
instance https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values
)

Without this commit we end up with an array of accepted type like
`("text/html", "*/*;q=0.8)` so when we then check if the array contains
`*/*` the check fails, and we return a 406 even though the client is
able to get the response.

This commit fixes it by removing the `;q=0.8` part.

(Ideally we should not just discard that part, we should extract that
 value, and order by it. See
 https://developer.mozilla.org/en-US/docs/Glossary/Quality_values for
 more info about that. However this could be done in a subsequent PR:
 this already fixes the 406 error, which is pretty blocking)
2023-07-24 11:34:12 +08:00
William Cheng
ec6381295a
Update php options for better customization of composer.json (#16078)
* update php options

* update tests
2023-07-12 13:22:05 +08:00
Guillaume Turri
22e1e4e450
[PHP-Symfony] fix name mismatch in generated README (#15961) (#15963)
This fixes the generated README so it  suggests to implement the `class DefaultApi`
in a file named DefaultApi.php (instead of DefaultApiInterface.php)
2023-07-02 23:34:04 +08:00
Guillaume Turri
7572e73b8e
[PHP-Symfony] Fix Symfony warning on OpenAPIServerBundle (#15960)
This fixes this Symfony warning:

    User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()"
    might add "void" as a native return type declaration in the future. Do the
    same in child class "OpenAPI\Server\OpenAPIServerBundle" now to avoid errors
    or add an explicit @return annotation to suppress this message

This fixes #15959
2023-07-02 23:33:37 +08:00
William Cheng
0c3460f95b Merge remote-tracking branch 'origin/master' into 7.0.x 2023-05-10 15:00:56 +08:00
Tiffany Marrel
9cb14aeb8c
[php] fix documentation of API authorization in README files (#15306)
fix hierarchy level + align wording across generators
2023-05-09 14:25:14 +08:00
William Cheng
935146d187 Merge remote-tracking branch 'origin/master' into 7.0.x 2023-04-12 17:51:47 +08:00
William Cheng
5d1e18306a
Prepare 6.6.0-SNAPSHOT (#15100)
* set 6.6.0 snapshot version

* update samples

* update readme
2023-04-01 18:48:01 +08:00
William Cheng
7417432a54
Prepare 6.5.0 release (#15099)
* 6.5.0 release

* update samples
2023-04-01 15:03:35 +08:00
Guillaume Turri
9fd989e297
[PHP-Symfony] Fixes #14930 (#14933)
* [PHP-Symfony] fixes validation of date-time parameter

This fixes parts of #14930.

Without this patch a parameter declared as date-time
is validated against Symfony's "DateTime" constraint,
which always fails. Because this constraint expects
a string with format "Y-m-d H:i:s".
It fails because the generated code performs the check
after the deserialization, so the variable checked is not
a string anymore.

Besides this, even if we performed that validation on the
string, that would not work well because OpenApi
specification expects date-time to conform to RFC 3339
and that "Y-m-d H:i:s" would reject RFC 3339 compliant dates.

With this change we ensure that the string provided by the
web user could be parsed by PHP to DateTime, which solves both issues.

(Note however that it means that it now accepts more formats than just
RFC 3339 compliant ones for those parameters (it would accept all formats
accepted by PHP DateTime). That being said it's compliant with the guideline
""be conservative in what you send, be liberal in what you accept")

* [PHP-Symfony] Fix handling of null date-time parameter

This fixes one of the issue described on #14930, namely that
the deserializeString method of the generated class JsmSerializer returns null
for other types of string, but not for date-time. Instead it returns a DateTime
which represents "now" (because that what `new DateTime(null)` does).

Consequently when an API declares a date-time parameter as non-required and
when that endpoint is called without that parameters, then the user code
would end up having "now" instead of "null" for this parameter.
2023-03-14 11:17:34 +08:00
William Cheng
1beec7ef87 Merge remote-tracking branch 'origin' into 7.0.x 2023-03-03 21:52:50 +08:00
William Cheng
c50a775e0c
prepare 6.5.0 release (#14749) 2023-02-19 20:36:23 +08:00
William Cheng
93df0ff444
Prepare 6.4.0 release (#14748)
* prepare 6.4.0 release

* update samples
2023-02-19 18:53:20 +08:00
Beppe Catanese
68b944e6e6
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
2023-02-10 22:20:19 +08:00
William Cheng
31a89e35cb
Prepare 6.4.0 (#14582)
* update to 6.4.0 snapshot

* update samples

* update doc
2023-02-01 22:44:40 +08:00
William Cheng
8f2676c5c2
Prepare v6.3.0 release (#14580)
* 6.3.0 release

* fix maven plugin test

* update samples

* update doc

* fix tests in windows
2023-02-01 20:52:29 +08:00
renaud-twd
efdc94b113
Fix enum generation for php-symfony generator (#14105)
* fix(symfony): enum generation

* docs(php symfony): update samples and docs
2022-12-27 23:42:41 +08:00
William Cheng
90a8b4effb
[PHP] better PHP symfony test (#14117)
* better php symfony test

* trigger build failure

* Revert "trigger build failure"

This reverts commit ed7a57ead2726705fe733a7027717b864810843f.

* update samples
2022-11-25 15:01:02 +08:00
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
William Cheng
2bac0a8d99 Merge remote-tracking branch 'origin/6.3.x' into 7.0.x 2022-10-16 21:27:53 +08:00
William Cheng
4d03c9272b prepare 6.3.0 snapshot 2022-10-15 15:40:47 +08:00
William Cheng
ac7ebf67dd
Prepare 6.2.1 (#13517)
* update to 6.2.1-SNAPSHOT

* update samples

* update doc
2022-09-25 00:10:30 +08:00
William Cheng
24f476a381
prepare 6.2.0 release (#13514)
* set release version to 6.2.0

* update samples

* comment out rust server test in travis
2022-09-24 21:44:42 +08:00
Luka Dschaak
c4a3866e75
[PHP-Symfony] Encurage Symfony 5 bundle directory structure best practices (#13014)
* use .yaml instead of .yml

This is recommended by Symfony standards

* save Bundle files also to src path

* add test for generate ping

* add package imports

* fix expected file names

* why is Api/ApiServer.php missing

* output filenames

* use getAbsolutePath for debug purpose

* do not use punctuation as current directory

* refactor: remove todos

* use also .yaml in test to fix it

* add test for setting a different source directory

* use correct const for setting source dir property in tests

* import the AbstractPhpCodegen in test class

* put also Resources to source path

* save docs not to Resources

* update samples and improve src path in autoload.php and composer.json

* update moved samples
2022-09-18 15:16:27 +08:00
William Cheng
928070c57a
Prepare 6.1.1 SNAPSHOT version (#13399)
* prepare v6.1.1

* update samples

* update doc
2022-09-11 19:08:23 +08:00
William Cheng
43dbb5ff9c
6.1.0 release (#13398) 2022-09-11 17:16:07 +08:00
William Cheng
6bfef6c191 Merge remote-tracking branch 'origin/master' into 7.0.x 2022-07-19 11:54:20 +08:00
William Cheng
6cae0fbb78 Merge remote-tracking branch 'origin/6.1.x' 2022-07-04 01:22:51 +08:00
William Cheng
9e412edb64
Prepare 6.0.1 release (#12762)
* update to v6.0.1

* update doc

* update samples
2022-07-03 23:36:46 +08:00
Daniel Metzner
3b15bb8a4e
[PHP] Enhance Symfony generator (#12532)
* Enhance Symfony generator

  - Add missing typehints
  - Add missing use statements
  - Simplify model ctor
  - Change fallthrough Exception to Throwable
  - prevent storing result of void methods
  - fix validate method
  - add default null values to model properties
  - simplify API interface return values
  - fix/rework default value implementation
  - fix optional params deprecation warnings
  - ..

For more details check out the PR: https://github.com/OpenAPITools/openapi-generator/pull/12532

* Enhance Symfony generator Tests

  - Skip risky tests
  - Fix type hint error
  - Fix class exists tests
  - Fix broken doc block
  - Enhance annotations
  - Update phpunit.xml.dist
  - Fix test config resource location
2022-06-25 20:53:21 +08:00
Daniel Metzner
f30257d10a
Fix syntax error for $jsonDeserializationVisitor (#12521) 2022-06-04 18:35:33 +08:00
William Cheng
38018d8b94
Test PHP Symfony server sample in github action (#12533)
* test php symfony server sample in github action

* update php laravel samples

* add tests for php 7.x, 8.x
2022-06-04 18:23:28 +08:00
Cubid
fb1706bd2b
[php-symfony] Allow non mandatory array value (#11618)
Co-authored-by: David CLEMENT <dclement@cfdp.fr>
2022-05-27 00:54:04 +08:00
William Cheng
c54b0623b8 prepare 7.0.x 2022-05-26 13:17:52 +08:00