204 Commits

Author SHA1 Message Date
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
William Cheng
5bd94b8fa0 prepare 6.1.x 2022-05-26 12:58:25 +08:00
William Cheng
36a9cf394d
update samples (#12466) 2022-05-26 12:13:59 +08:00
William Cheng
69f79fb789
Prepare 6.0.0 release (#12463)
* prepare 6.0.0 release

* update samples

* update meta codegen
2022-05-26 10:28:01 +08:00
William Cheng
621f87b5e6
minor enhancements to php symfony 6 generator (#12455) 2022-05-25 16:12:22 +08:00
William Cheng
16365ac989 update php symfony samples 2022-05-25 15:39:56 +08:00
Benjamin Häublein
77fa028bb3
[php-symfony] Symfony6 support (#11810)
* support symfony6

* fix issues with StrictJsonDeserialization

* regenerate samples

* add suggestions

* update samples

* support php 7.4 and symfony 5

* allow versions based on semantic versioning

* regenerate sample

* change method of determining result types

* update samples

* describe usage of bundle in symfony app

* better documentation

* fix duplicate auth methods

* do not set namespace for default types

* fix UploadedFile type

* next try fixing auth

* regenerate samples

* fix: auth method shall not be duplicated

* Revert "fix duplicate auth methods"

This reverts commit 0dc418737b1379a30b7f22e7937819ba965c9ddb.

* chore: regenerate samples

* fix tests

* regenerate sample

* more fixes for tests

* update tests

* add kernel shutdown

Co-authored-by: Benjamin Haeublein <benjaminh@testing-vm.lan.benjaminh.de>
Co-authored-by: Renaud de Chivré <renaud@tahitiwebdesign.com>
2022-05-25 15:34:50 +08:00
William Cheng
8e49875871 update samples, docs 2022-04-24 15:38:16 +08:00