jcabi / jcabi/jcabi-github

Got an exception when trying to get contents

Open
#903 22 comments 0 reactions 0 assignees View on GitHub
bug DEV TS/FIX
Dominant language
Java
Stars
307
Forks
144
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Following `Contents.get()` method, we got an exception

``` java
final Repos repos = github().repos();
final Repo repo = repos.get(new Coordinates.Simple("jcabi/jcabi-github"));
System.out.println(new Content.Smart(repo.contents().get("src/main/java/com/jcabi/github/Users.java")).url());
// #output https://api.github.com/repos/jcabi/jcabi-github/contents/src/main/java/com/jcabi/github/Users.java?ref=master
System.out.println(new Content.Smart(repo.contents().get("src/main/java/com/jcabi/github/mock")).url());
```

ERROR LOG

```
https://api.github.com/repos/jcabi/jcabi-github/contents/src/main/java/com/jcabi/github/Users.java?ref=master
[INFO] main com.jcabi.http.request.BaseRequest: #fetch(GET api.github.com /repos/jcabi/jcabi-github/contents/src/main/java/com/jcabi/github/mock): [200 OK] in 2s

javax.json.JsonException: Cannot read JSON object, found JSON array
at org.glassfish.json.JsonReaderImpl.readObject(JsonReaderImpl.java:105)
at com.jcabi.http.response.JsonResponse$VerboseReader.readObject(JsonResponse.java:159)
at com.jcabi.github.RtContents.content(RtContents.java:266)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.