Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/parsing empty data #19

Merged
merged 8 commits into from
Jan 29, 2019
Merged

Feature/parsing empty data #19

merged 8 commits into from
Jan 29, 2019

Conversation

fgulan
Copy link
Member

@fgulan fgulan commented Jan 25, 2019

Please double check if it is correct - all tests pass on my machine.

@@ -285,7 +285,7 @@ private extension Japx.Decoder {
.map { try resolve(object: $0,
allObjects: allObjects,
paramsDict: try paramsDict.dictionary(for: relationshipsKey)) }
if otherObjects.isEmpty { return }

let isObject = relationship[Consts.APIKeys.data].map { $0 is Parameters } ?? false
result[relationshipsKey] = (isObject && otherObjects.count == 1) ? otherObjects[0] : otherObjects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if isObject { result[relationshipsKey] = (otherObjects.count == 1) ? otherObjects[0] : NSNull() }
else { result[relationshipsKey] = otherObjects }

Copy link
Member

@Truba Truba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fgulan
Copy link
Member Author

fgulan commented Jan 29, 2019

Great, please don't merge yet. I'll update Bitrise config for it.

@fgulan
Copy link
Member Author

fgulan commented Jan 29, 2019

@Truba merge freely

@Truba Truba merged commit e5c5690 into master Jan 29, 2019
@Truba Truba deleted the feature/parsing-empty-data branch January 29, 2019 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants