Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 702c0b3

Browse files
author
Mateusz Gostanski
committed
Bug fixed in StraightKeyParser
1 parent 209e932 commit 702c0b3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `api-client` will be documented in this file
44

5+
## 3.2.1 - 2021-05-04
6+
7+
- Bug fixed in `StraightKeyParser`
8+
59
## 3.2.0 - 2021-04-29
610

711
- Use snake_case naming convention in results data array instead of camelCase

src/Data/StraightKeyParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function parseElement(array $input): array
4444
$dtoFieldName = $field->getName();
4545
$arrayFieldName = Str::snake($dtoFieldName);
4646

47-
if ($dtoFieldName === 'relationships') {
47+
if ($dtoFieldName === 'relationships' && isset($input[$arrayFieldName])) {
4848
$data[$dtoFieldName] = $this->parseRelationship($input[$arrayFieldName]);
4949
} else {
5050
$data[$dtoFieldName] = $input[$arrayFieldName] ?? null;

0 commit comments

Comments
 (0)