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)
* 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
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.
* [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)
* 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.
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)
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
* [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.
* 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