Skip to content

Commit

Permalink
Fixed minor fatal errors (#16)
Browse files Browse the repository at this point in the history
* Added missing public declarations

* Minor fix

* Added ArrayDenormalizer for correct body handling
  • Loading branch information
DimanKuskov authored and sspat committed Jan 26, 2020
1 parent ef2eb32 commit b36226f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/CodeGenerator/Dto/PhpParserRootDtoFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public function generateRootDto(
$this
->factory
->method('getPathParameters')
->makePublic()
->setReturnType($pathParametersDtoClassName)
->addStmt(new Return_(new Variable('this->pathParameters')))
);
Expand Down Expand Up @@ -120,6 +121,7 @@ public function generateRootDto(
$this
->factory
->method('getQueryParameters')
->makePublic()
->setReturnType($queryParametersDtoClassName)
->addStmt(new Return_(new Variable('this->queryParameters')))
);
Expand All @@ -138,6 +140,7 @@ public function generateRootDto(
$this
->factory
->method('getBody')
->makePublic()
->setReturnType($requestBodyDtoClassName)
->addStmt(new Return_(new Variable('this->body')))
);
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
<argument key="$propertyTypeExtractor" type="service" id="Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor" />
</service>
<service id="Symfony\Component\Serializer\Normalizer\DateTimeNormalizer" />
<service id="Symfony\Component\Serializer\Normalizer\ArrayDenormalizer" />
<service id="Symfony\Component\Serializer\Encoder\JsonEncoder" />
<service id="openapi.bundle.serializer" class="Symfony\Component\Serializer\Serializer">
<argument key="$normalizers" type="collection">
<argument type="service" id="Symfony\Component\Serializer\Normalizer\PropertyNormalizer" />
<argument type="service" id="Symfony\Component\Serializer\Normalizer\DateTimeNormalizer" />
<argument type="service" id="Symfony\Component\Serializer\Normalizer\ArrayDenormalizer" />
</argument>
<argument key="$encoders" type="collection">
<argument type="service" id="Symfony\Component\Serializer\Encoder\JsonEncoder" />
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/ReflectionDtoSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private function setRequestBody(object $inputDto, ReflectionClass $inputDtoRefl,
);
}

private function getInputDtoFQCN(string $serviceInterface, string $methodName) : string
private function getInputDtoFQCN(string $serviceInterface, string $methodName) : ?string
{
$interfaceReflectionClass = new ReflectionClass($serviceInterface);
$method = $interfaceReflectionClass->getMethod($methodName);
Expand Down

0 comments on commit b36226f

Please sign in to comment.