spring-io/sagan — pull request #433 by ttddyy (2014-06-25 06:00:34+00:00)
Title: Fix json mapping to get github username

When I run "Import Team Member From Github" on admin page, it was throwing stacktrace:
```
2014-06-24 21:48:05.981 ERROR 5736 --- [nio-9090-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
at [Source: java.io.StringReader@3741e5e; line: 1, column: 1247]] with root cause

com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
at [Source: java.io.StringReader@3741e5e; line: 1, column: 1247]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
...
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2105)
at sagan.team.support.DefaultTeamImporter.getNameForUser(DefaultTeamImporter.java:60)
at sagan.team.support.DefaultTeamImporter.importTeamMembers(DefaultTeamImporter.java:43)
...
```

This was because, the response from github API contains nested hash in `plan` field (for [authenticated user](https://developer.github.com/v3/users/#get-the-authenticated-user) only??):

```
> curl https://api.github.com/users/ttddyy -u $TOKEN:x-oauth-basic
{
"login": "ttddyy",
"name":"Tadaya Tsuyukubo"
...
"plan": {
"name": "free",
"space": 307200,
"collaborators": 0,
"private_repos": 0
}
}
```

This caused binding error from json to `Map` because the value of "plan" is not a string.

I changed the json binding to only read the "name" field to avoid "plan" field type mismatch.

Thanks,