Skip to content

[BUG] Symfony4 StrictJsonDeserializationVisitor::visitString declaration incompatible #1996

Closed
@BenjaminHae

Description

@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: #1003
Start the server

php bin/console server:start 0.0.0.0:8000

and visit an endpoint.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions