Skip to content

Commit 2390f75

Browse files
author
Mladen Đuđić
committed
fix: Added data format to avoid issues with parsing float
- Removed deprecated repository for JSON API core lib - Reference for float issue: vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php - line 479
1 parent 497ff50 commit 2390f75

File tree

3 files changed

+17
-36
lines changed

3 files changed

+17
-36
lines changed

composer.json

-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
"phpunit/phpunit": "^7.5",
2727
"zantolov/toolbelt-dev": "^0.0.2"
2828
},
29-
"repositories": [
30-
{
31-
"type": "vcs",
32-
"url": "[email protected]:undabot/json-api-core.git"
33-
}
34-
],
3529
"autoload": {
3630
"psr-4": {
3731
"Undabot\\SymfonyJsonApi\\": "src/"

composer.lock

+14-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Service/Resource/Denormalizer/ResourceDenormalizer.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class ResourceDenormalizer
2424
/** @var DenormalizerInterface */
2525
private $denormalizer;
2626

27+
private const DATA_FORMAT = 'json';
28+
2729
public function __construct(ResourceMetadataFactoryInterface $metadataFactory, DenormalizerInterface $denormalizer)
2830
{
2931
$this->metadataFactory = $metadataFactory;
@@ -49,7 +51,7 @@ public function denormalize(ResourceInterface $resource, string $class): ApiMode
4951

5052
try {
5153
/** @var ApiModel $result */
52-
$result = $this->denormalizer->denormalize($data, $class, null, [
54+
$result = $this->denormalizer->denormalize($data, $class, self::DATA_FORMAT, [
5355
AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES => true,
5456
]);
5557
} catch (MissingConstructorArgumentsException $e) {

0 commit comments

Comments
 (0)