[BUG] Symfony4 StrictJsonDeserializationVisitor::visitString declaration incompatible
Created by: BenjaminHae
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
When generating the code for php-symfony
it does not work as intended with symfony 4.2.2.
Running
php bin/console server:start 0.0.0.0:8000
and visiting an registered endpoint leads to the following fatal error:
(1/1) FatalErrorException
Compile Error: Declaration of OpenAPI\Server\Service\StrictJsonDeserializationVisitor::visitString($data, array $type, JMS\Serializer\Context $context) must be compatible with JMS\Serializer\JsonDeserializationVisitor::visitString($data, array $type): string
--
in StrictJsonDeserializationVisitor.php line 23
openapi-generator version
master, v4.0.0-beta, latest
Command line used for generation
docker run --rm -v ${PWD}:/local test/openapi-generator-cli generate -i /local/swagger.yaml -g php-symfony -o /local/4Symfony
Steps to reproduce
Implement a symfony4 application by doing step 1 through 5 of the README. Then apply the fix for private controllers: https://github.com/OpenAPITools/openapi-generator/pull/1003 Start the server
php bin/console server:start 0.0.0.0:8000
and visit an endpoint.