Parse strings into dictionaries in coerce-to-dictionary #3270
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.
Change-Id: Ib8656bb97ce9d9bfa9cdeb711b0f2425d834a8bf
General items:
ant tests
passes on my machineIf your code changes how something works on the device (i.e., it affects the companion):
ucr
ucr
as the baseFurther, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):
For all other changes:
master
master
as the baseWhat does this PR accomplish?
A common pattern is that a REST call using the Web component will return JSON, but the responseContent parameter is always a string. People naturally try to pass this into a dictionary block thinking it is a dictionary, but this errors out. This PR adjusts the logic of
coerce-to-dictionary
so that if it is given a string it will parse it into a dictionary. We might be able to make it more efficient if we somehow cache the result of the parsing so multiple calls don't result in multiple parsing passes, but that can be an improvement left for another time.