Fixes "Bad JSON: expected object value" #395
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.
Fixes the following issue:
The Dropbox API v2 Java SDK can crash with "com.dropbox.core.BadResponseException: Bad JSON: expected object value." when deserializing a 'file_locking_lock_status_changed' event
If a new tag & type is added, it should default to "OTHER".
This had worked for new tag cases that have no fields, however, if a JSON response had additional fields, it messed up the parser state and would throw an exception.
Fix: In the scenario where we have fields returned for an unknown tag, we have to skip to the next token in this case to continue on. I have added 4 permutations of test cases along a matrix of (known/unknown) & (fields/no fields). This should cover these scenarios.