When most of the api calls returning a collection of objects use the same key path, then the code to write those requests is very redundant.
For instance, in Yummypets near 50 requests are wrapped in a "collection" key path.
Thanks to a default collection parsing key, the code becomes more concise.
For readability's sake, the old jsonParsingColletionKey has been made unavailable and renamed to a more understandable defaultCollectionParsingKeyPath used like so :
ws.defaultCollectionParsingKeyPath = "collection"
Reasons
Writing this keypath evertime is very redundant.
This used to be supported and removing this useful feature would break client code, and this silently, which is very dangerous.
This would also require people to write more code, which is against what we're trying to achieve ))
Best of both worlds
Of course, the defaultCollectionParsingKeyPath is overriden if a keypath is passed per request.
This allows both default and per-request configuration, allowing best of both worlds.
Use case
When most of the api calls returning a collection of objects use the same key path, then the code to write those requests is very redundant. For instance, in Yummypets near 50 requests are wrapped in a
"collection"
key path.Thanks to a default collection parsing key, the code becomes more concise.
For readability's sake, the old
jsonParsingColletionKey
has been made unavailable and renamed to a more understandabledefaultCollectionParsingKeyPath
used like so :Reasons
Writing this keypath evertime is very redundant.
This used to be supported and removing this useful feature would break client code, and this silently, which is very dangerous.
This would also require people to write more code, which is against what we're trying to achieve ))
Best of both worlds
Of course, the
defaultCollectionParsingKeyPath
is overriden if a keypath is passed per request.This allows both default and per-request configuration, allowing best of both worlds.