Skip to content

Commit

Permalink
Adds note about gson map decoding to README (OpenFeign#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancole authored and spencergibb committed Aug 29, 2016
1 parent 6fd4049 commit 7ccc965
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ GitHub github = Feign.builder()
.decoder(new GsonDecoder())
.target(GitHub.class, "https://api.github.com");
```

### Map<String, Object> and Numbers
The default constructors of `GsonEncoder` and `GsonDecoder` decoder numbers in
`Map<String, Object>` as Integer type. This prevents reading `{"counter", "1"}`
as `Map.of("counter", 1.0)`. This uses an internal class in gson.

If you want the default behavior, or cannot use gson internal classes (ex in
OSGi), please use the constructors that accept a Gson object.

0 comments on commit 7ccc965

Please sign in to comment.