22 Commits

Author SHA1 Message Date
Julian Vennen
6bd3d53eee
[PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582) (#19529)
* [PHP/Dart/Python] Correctly escape strings in single quotes (Fixes #17582)

* Move escapeTextInSingleQuotes method to DefaultCodegen, add docblock
2024-11-09 16:50:12 +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
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
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
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00
Nathan Baulch
ca5de9d503
[php] Deprecated annotation on operations and fields (#10085) 2021-08-04 17:29:19 +08:00
William Cheng
c285f393b0
switch to oas3 spec for php-symfony samples (#9248) 2021-04-14 10:36:48 +08:00
vnq
74e5c3ccd3
[php-symfony] remove nested Valid constraint (#8994)
* Fix constraint Valid cannot be nested

* Update PetController.php

* Update UserController.php
2021-03-24 13:30: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
Yuriy Belenko
83bad102ea
[php-symfony] Set required PHP version ^7.1.3 (#6181)
* Set PHP 7.1.3 required version

I've tried to specify ^7.0 version at first, but main package which is
symfony/framework-bundle@v4.4.8 requires PHP ^7.1.3.

* Bump Symfony FrameworkBundle to ^4.4.8

Current Symfony Framework stable version is v5.0.8, but I guess it
requires significant codebase upgrade, so I've sticked with 4.4.8 which
shouldn't cause any breaking changes. Old requirement was ^3.3|^4.1
which compatible with 4.4.8.

* Bump PHPUnit version to ^7.0

PHPUnit 8.x version required PHP ^7.2, so I'm setting 7.x version to
support PHP 7.1.
There is new way to specify Kernel class, related PR:
https://github.com/symfony/symfony/pull/22668

* Bump PHP CS Fixer version to ^2.16.3

Configuration and all renamed rules fixed.
Config file renamed to .php_cs.dist as recommended in migration guide.
Migration guide from 1.x to 2.x:
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md#config-file

* Remove PHP_CodeSniffer package

Second linter doesn't make sense. I think Symfony user would prefer
PHP CS Fixer over PHP_CodeSniffer because first one maintained by Symfony
members.

* Remove satooshi/php-coveralls package from Composer

This package is abandoned and Coveralls recommends to install it directly
in Travis-CI task script.

* Update Travic-CI config

I've changed test versions to PHP 7.1.3 and 7.2. PHPUnit generates
coverage report in report/logs/clover.xml file. Then PHP CS Fixer runs
with --dry-run option to not override anything just to show coding style
errors.

* Add basic Coveralls config

This is basic recommended config for a PHP based project.

* Add symfony/yaml package

This package was part of satooshi/php-coveralls, now it should be
defined as dev dependency.

* Do not commit composer.lock

I think committed composer.lock can cause CI errors while tests on fresh
installs are better.

* Remove confusing Ruby comment
2020-05-29 18:35:11 +08:00
Artem
3e2c933dec
[php-symfony] Fix problem with clients, that put charset in content type header. (#6078)
* Fix problem with clients, that put charset in content type header.

With this fix header "Content-Type: application/json; charset=utf-8" working same as "Content-Type: application/json" for parse input data

* Fix code style, add $consumes length check.

* Add isContentTypeAllowed static method and tests

* Fix old tests

Right now serializer doesn't support anything beside json and xml.
Call tests with application/json instead of form data.

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2020-04-30 12:22:44 +03:00
William Cheng
dc0c24b955
Minor wording change (#2875)
* better wording for version of openapi doc

* update petstore samples
2019-05-13 15:59:59 +08:00
Gocha Ossinkine
161cb88e88 Don't try to detect response format if method return nothing (#2073) 2019-02-14 19:55:40 +09:00
Gocha Ossinkine
d87a3b90da Validate input objects (#2144) 2019-02-14 19:32:21 +09:00
Gocha Ossinkine
73d309b9ba Catch serializer exception (#2074) 2019-02-10 15:41:09 +08:00
Matej Vehar
f4088f8ee8 Enable serialization of non-null negative values (array, false, etc) (#2032) 2019-02-04 15:25:16 +09:00
Jérémie Bresson
a7dfc650b6 Swagger parser update: 2.0.8-OpenAPITools.org-1 (#1721)
* Update Swagger-Parser Version

* Update samples

* surpress javadoc warning

* fix TS tests

* Set version to 2.0.8-OpenAPITools.org-1
2018-12-22 18:12:08 +08:00
Akihito Nakano
872dd546f4 Update php related samples (#375)
* Update php client (OAS3)

bin/openapi3/php-petstore.sh

* Update symfony server (OAS2)

bin/php-symfony-petstore.sh

* Lumen: remove 'swagger'

* Update lumen server (OAS2)

* Update php client (security): deleted 'SwaggerClient-php' folder

* Update TEST_DIR

* Update php client tests (OAS3)

bin/openapi3/php-petstore.sh

* Update php client (OAS2)

bin/php-petstore.sh

* Fix

* Fix lumen -> php-lumen

* Update lumen server (security)

* Delete moved files

currently it will generate into under 'lib' folder.

* Fix slim -> php-slim

* Update slim server (security)

bin/security/slim-petstore-server.sh

* Fix

* Update dot files
2018-05-09 10:34:19 +08:00
William Cheng
7ad92572e4
Update default value for PHP server generators (slim, silex) (#272)
* update php slim samples

* update php silex samples

* update php silex default value
2018-04-30 15:18:13 +08:00
William Cheng
69133d3677
Update PHP Symfony server petstore with OAS2, OAS3 (#255)
* update php symfony with oas2 petstore

* update php symfony with oas3 petstore
2018-04-28 14:38:37 +08:00
naelrashdeen
5d59dd10ec [PHP][Symfony] Further enhancements (#7001)
* Further enchancements for PHP-Symfony. Fixes issues described in #6999

* Ran shell script to update petstore sample
2017-11-27 16:25:50 +08:00
naelrashdeen
b034e4446a [PHP][Symfony] Enhancements (#6615)
* Removed commented code

* Input validation is now supported as strict JSON validation

* [PHP][Symfony] Improve the implementation
Closes #6614

* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer

* Updated shell script because shippable tests were failing
2017-10-23 22:50:56 +08:00