Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes "Bad JSON: expected object value" #395

Merged
merged 3 commits into from
Jul 8, 2022

Conversation

handstandsam
Copy link
Contributor

@handstandsam handstandsam commented Jul 8, 2022

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.

@handstandsam handstandsam changed the title Fixes "Bad JSON: expected object value" [WIP] Fixes "Bad JSON: expected object value" Jul 8, 2022
@handstandsam handstandsam force-pushed the handle-unknown-complex-type-payload branch from 2af62ae to 87ef7ae Compare July 8, 2022 19:21
@handstandsam handstandsam changed the title [WIP] Fixes "Bad JSON: expected object value" Fixes "Bad JSON: expected object value" Jul 8, 2022
@handstandsam handstandsam merged commit 66c8bc9 into master Jul 8, 2022
@handstandsam handstandsam deleted the handle-unknown-complex-type-payload branch July 11, 2022 21:54
@handstandsam handstandsam added this to the 5.3.0 milestone Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants