vimeo / vimeo/vimeo-networking-java

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

Open
#416 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
128
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Issue Summary

Getting the error:

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

Here's my code:
public void onCreate(Bundle savedInstanceState) {
        Log.i(TAG, "onCreate");
        super.onCreate(savedInstanceState);
        final Video video = VideoPlayActivity.video;

        TestApp d = new TestApp();
        d.onCreate();
        mApiClient = d.getmApiClient();

        String uri = video.getVideoUri().toString();
        mApiClient.getInstance().fetchNetworkContent(uri, new ModelCallback<Video>(Video.class) {
            @Override
            public void success(Video video) {
                Log.i(TAG, "get success.");
                // use the video
            }

            @Override
            public void failure(VimeoError error) {
                Log.i(TAG, error.getErrorMessage());
                // voice the error
            }
        });
}
And these are the important methods in TestApp:
public class TestApp extends Application {
@Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG, "onCreate");

        sContext = this;

        Configuration.Builder configBuilder = getClientIdAndClientSecretBuilder();
        VimeoClient.initialize(configBuilder.build());
        mApiClient = VimeoClient.getInstance();
    }
    
    public Configuration.Builder getClientIdAndClientSecretBuilder() {
        String clientId = "dc62dc72e8c7cf4d0b7bb025d41e2a7649ddc0a4";
        String clientSecret = "SRbzt7mLfbA0l5aEV8lXINE54nRGkSp8S2i+wOp9paOqQsEKkwC5MtdwFPHiVqX7DTCooPVWAxPVjG8/pjjPbl+7LNTXTuSDit1oZGtCjkBYFqahb95J4pAHzEumdNhs";
        return new Configuration.Builder(clientId, clientSecret, SCOPE);
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at fetchNetworkContent and the ModelCallback path shown in the report, then trace where the response is parsed and where the JsonReader error is produced. Compare the received response with the expected JSON and determine the intended handling for malformed or non-JSON content; done means the failure is explained and covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
api, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.