> So I suppose my question still stands how best to resolve this issue of the Contents API either returingn a single JSON object or an array.

If you need to predetermine whether the response will be an array or a hash, you could get that information by fetching the contents of the parent directory first. For example, suppose you want to make this request:

    GET https://api.github.com/repos/twbs/bootstrap/contents/js

And you want to know whether the response will be an array or a hash. You could first make a request to:

    GET https://api.github.com/repos/twbs/bootstrap/contents

The response will provide an array of items in the root directory:

```
...
  {
    "name": "js",
    "path": "js",
    ...
    "type": "dir",
   ...
  },
...
```

If the `type` is `dir`, you will know that it's a directory. With that information, you can safely expect to get an array in response to this request:

    GET https://api.github.com/repos/twbs/bootstrap/contents/js

Does that help?