Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Array Decoding Semantics #189

Closed
htinlinn opened this issue Jul 29, 2016 · 4 comments
Closed

Array Decoding Semantics #189

htinlinn opened this issue Jul 29, 2016 · 4 comments

Comments

@htinlinn
Copy link

The current default behavior of the decoder when decoding arrays is to return an empty array even if it couldn't decode individual elements. The only requirement there is that the key must exist.

Updating these functions to return nil instead would make them more consistent with how the rest of the decoder functions behave. Caller gets a value back if the JSON can be decoded and nil otherwise.

@hkellaway
Copy link
Owner

suggested changes have been merged into develop.

because this represents an API change, this won't come out until 0.8.0 is released - which may not be for some months. until then, have your project point to develop or commit 39bf67ba74141951a42946716a08cc7e1019e626 to be more specific.

@htinlinn
Copy link
Author

htinlinn commented Aug 1, 2016

Changes made seem to cover only one of the many array decoding functions. decodeDecodableArray, decodeEnumArray, etc... needs updating as well.

@hkellaway
Copy link
Owner

hkellaway commented Aug 2, 2016

ah! i only covered fromJSONArray and toJSONArray. will update.

@hkellaway
Copy link
Owner

updated. you can point toward develop for the latest, or commit 7868347e2fc93487d1a9d2cb4621a88b247986e4 to be more specific

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants