Fix configuration settings for configuration class. #1130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new configuration API has an odd feature where the default settings
have this behavior:
if the parsed data has a top level json array and there is one entry in the array then the
entry is returned, If there are multiple entries in the array then an
array is returned. This requires the developer to handle the one and
many cases separately.
This lead to a bug because the code assumed that the data was always being returned in
an array. This change sets the configuration class parameter
force_array_return
so that the resource information is always returned in an array data structure.
This API design seems bug prone since the defaults settings are almost always not what you want. See issue for follow up: https://app.asana.com/0/342819846538629/1146629814310601